Friday, October 30, 2015

macos - Can't delete a directory in Mac

We have a bundle App.component and inside it we have a 'Contents' directory with the following permissions:


 drwxrwxrwx  4 root  wheel  136 Mar 18 15:05 Contents

When I try to delete this directory using


rm -rf Contents

It fails with the reason


rm: Contents//MacOS/APP: Permission denied
rm: Contents//MacOS: Directory not empty
rm: Contents//Resources/App.rsrc: Permission denied
rm: Contents//Resources: Directory not empty
rm: Contents/: Permission denied

lsof shows that there are no processes that are using this bundle
and running stat Contents/Resources/App.rsrc outputs:


234881026 3691189 -rw-r--r-- 1 root wheel 0 733 "Mar 18 16:10:13 2012" "Mar  8 17:00:18 2012" "Mar 18 15:04:39 2012" "Mar  8 17:00:18 2012" 4096 8 0 Contents/Resources/App.rsrc

We do have permissions to delete the 'Contents' directory so why does it still fails?


Edit: If I move the bundle from /Library/Audio/Plug-Ins/Component to ~/tmp/ then It will delete the folder without any problems


Thank you

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...