Tuesday, December 10, 2019

#1 2019-10-14 10:30:17 am

Titanium
Member
From:: ~/Desktop
Registered: 2005-08-22
Posts: 61
Website

Catalina: rm command don't work

Hello,

With Catalina, the rm command don't work anymore from the Script Editor application or from my application (signed and notarised or not). It perfectly works in Mojave.

Message: Operation not permitted roll

Full Disk Access is permitted in the System Preferences.

Do you know why?

Thanks a lot.


iMac 27" 3,4 Ghz - MacOS  Catalina
https://www.titanium-software.fr

Offline

 

#2 2019-10-14 06:41:30 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 6065

Re: Catalina: rm command don't work

It works in test here. It sounds like the issue is with what you're trying to delete rather than the command itself.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#3 2019-10-15 04:06:52 am

Titanium
Member
From:: ~/Desktop
Registered: 2005-08-22
Posts: 61
Website

Re: Catalina: rm command don't work

Thanks Shane but I don't think... Delete the content of the trash, for example or delete a simply file or folder in the Documents folder recently created.Perhaps a problem with my system (Clean Install)


iMac 27" 3,4 Ghz - MacOS  Catalina
https://www.titanium-software.fr

Offline

 

#4 2019-10-15 04:56:41 am

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 6065

Re: Catalina: rm command don't work

The Trash is a protected directory, as is Desktop. I'm not sure about Documents. having said that, my successful test was a file on the Desktop.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#5 2019-10-24 12:18:12 pm

TheIaMonLyOneHeRe
Member
Registered: 2018-09-16
Posts: 35

Re: Catalina: rm command don't work

Titanium wrote:

Hello,

With Catalina, the rm command don't work anymore from the Script Editor application or from my application (signed and notarised or not). It perfectly works in Mojave.

Message: Operation not permitted roll

Full Disk Access is permitted in the System Preferences.

Do you know why?

Thanks a lot.



This is because from macOS Catalina system files are in another partition
which is read only, called DATA to access this partition you first need to mount it with
the following command:

Applescript:

do shell script "mount -uw /" with administrator privileges

after this the RM command will work.

Offline

 

#6 2019-10-24 12:59:46 pm

Titanium
Member
From:: ~/Desktop
Registered: 2005-08-22
Posts: 61
Website

Re: Catalina: rm command don't work

Thanks but...

error "mount_apfs: volume could not be mounted: Operation not permitted
mount: / failed with 77" number 77

With the Beta of Catalina, there was a Data partition visible everywhere, but in the Finale version, the Data partition is only visible in the Disk Utility.

Last edited by Titanium (2019-10-24 01:56:54 pm)


iMac 27" 3,4 Ghz - MacOS  Catalina
https://www.titanium-software.fr

Offline

 

#7 2019-10-24 09:54:11 pm

TheIaMonLyOneHeRe
Member
Registered: 2018-09-16
Posts: 35

Re: Catalina: rm command don't work

Please post a part of your code.

Offline

 

#8 2019-10-25 05:33:18 am

Titanium
Member
From:: ~/Desktop
Registered: 2005-08-22
Posts: 61
Website

Re: Catalina: rm command don't work

Hi,

In the Script Editor (or from Xcode):

[applescript]do shell script "rm -rf /Users/myaccount/.Trash/*" with administrator privileges[/AppleScript]

or

[applescript]do shell script "rm -rf ~/.Trash/*" with administrator privileges
[/AppleScript]


From the Terminal, these commands perfectly work.


iMac 27" 3,4 Ghz - MacOS  Catalina
https://www.titanium-software.fr

Offline

 

#9 2019-10-25 08:40:46 am

TheIaMonLyOneHeRe
Member
Registered: 2018-09-16
Posts: 35

Re: Catalina: rm command don't work

try:

Applescript:

do shell script "mount -uw /;killall Finder" with administrator privileges

Applescript:

do shell script "rm -rf ~/.Trash/" with administrator privileges

Last edited by TheIaMonLyOneHeRe (2019-10-26 06:43:22 pm)

Offline

 

#10 2019-10-25 12:15:26 pm

Titanium
Member
From:: ~/Desktop
Registered: 2005-08-22
Posts: 61
Website

Re: Catalina: rm command don't work

TheIaMonLyOneHeRe wrote:

try:

Applescript:

do shell script "mount -uw /;killall Finder" with administrator privileges

Applescript:

shell script "rm -rf ~/.Trash/" with administrator privileges



Operation not permitted


iMac 27" 3,4 Ghz - MacOS  Catalina
https://www.titanium-software.fr

Offline

 

#11 2019-10-26 06:05:31 pm

TheIaMonLyOneHeRe
Member
Registered: 2018-09-16
Posts: 35

Re: Catalina: rm command don't work

I did a test on a fresh install macOS Catlina, and everything works as expected.
The problem may be with your macOS Catalina installation.

Offline

 

#12 2019-10-26 06:14:42 pm

Titanium
Member
From:: ~/Desktop
Registered: 2005-08-22
Posts: 61
Website

Re: Catalina: rm command don't work

Thanks TheIaMonLyOneHeRe!

Very strange. Clean Install of Catalina.
The command rm without the administrator privileges perfectly works.

Applescript:

do shell script "rm -rf ~/.Trash/"


iMac 27" 3,4 Ghz - MacOS  Catalina
https://www.titanium-software.fr

Offline

 

#13 2019-10-26 06:41:12 pm

TheIaMonLyOneHeRe
Member
Registered: 2018-09-16
Posts: 35

Re: Catalina: rm command don't work

Titanium wrote:

Thanks TheIaMonLyOneHeRe!
The command rm without the administrator privileges perfectly works.

Applescript:

do shell script "rm -rf ~/.Trash/"


Good news, enjoy!

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)