5

We have a bundle myapp.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/Resources/myapp.rsrc: Permission denied rm: Contents/Resources: Directory not empty 

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

3
  • Could you check the permission and owner of that myapp.rsrc using stat Contents/Resources/myapp.rsrc? Commented Mar 18, 2012 at 13:31
  • 1
    Also, this probably belongs on superuser.com Commented Mar 18, 2012 at 13:34
  • If I move the bundle from /Library/Audio/Plug-Ins/Component to ~/tmp/ then It will delete the folder without any problems Commented Mar 18, 2012 at 14:32

2 Answers 2

10

You have permission to delete Contents, but not Contents/Resources/mypp.rsrc. If you do ls -l on that you'll see some more restrictive permissions.

In any case, from an admin account, you can do:

sudo rm -rf Contents 

and it should work fine.

Sign up to request clarification or add additional context in comments.

1 Comment

This is part of our automatic update process so we cannot use sudo here
1

The file is probably still open.

You can use the lsof command to list open files, and find out what's using them:

lsof | grep "myapp\.rsrc"

Will probably tell you about the program with that particular file open.

1 Comment

I run it and the file is not open by other processes, It used to work well so we're quite baffled here..

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.