2

I have file copied from an usb hard drive with a previous installation of os yosemite copied in it. Now I'm using Sierra.

The status of the file:

karim@doraemon:~/Downloads
$ ll Python.recipes.handbooks.pdf
-rw-r--r--@ 1 karim  staff   4.5M Jan  3 19:42 Python.recipes.handbooks.pdf

I have the same name user of my previous installation, maybe this could be a problem, but I'm not sure because from the finder, if I check permissions, I get 'Karim (Me)' as a owner.

karim@doraemon:~/Downloads
$ whoami
karim

I change the permissions:

karim@doraemon:~/Downloads
$ chmod 777 Python.recipes.handbooks.pdf

The file permissions are changed.

karim@doraemon:~/Downloads
$ ll Python.recipes.handbooks.pdf
-rwxrwxrwx@ 1 karim  staff   4.5M Jan  3 19:42 Python.recipes.handbooks.pdf

As you can see, I'can't modify the filename.

karim@doraemon:~/Downloads
$ mv Python.recipes.handbooks.pdf Python.recipes.handbooksaa.pdf
mv: rename Python.recipes.handbooks.pdf to Python.recipes.handbooksaa.pdf: Permission denied

I already checked on finder and the file is not locked.

As suggested I run this:

karim@d:~/Downloads
$ ls -leO@ Python.recipes.handbooks.pdf
-rwxrwxrwx@ 1 karim  staff  - 4758205 Jan  3 19:42 Python.recipes.handbooks.pdf
    com.apple.finder.copy.source.checksum#N       4
    com.apple.metadata:_kTimeMachineNewestSnapshot       50
    com.apple.metadata:_kTimeMachineOldestSnapshot       50
    com.dropbox.attributes       83
 0: group:everyone deny write,delete,append,writeattr,writeextattr,chown

The last line seems to explain what is happening on the file.

5
  • What permissions are on the Downloads folder itself? Does it only happen with this file or also with others? Can you rename the file directly from Finder?
    – nohillside
    Jan 13, 2017 at 5:43
  • Thanks for your answer. The parent folder is Download (chmod 700). All the files I copy from the external drive has this problems. With Finder I can edit, but I must enter the admin password Jan 13, 2017 at 5:52
  • The file has at least one extended attribute (indicated by "@"), and may also have access controls and/or flags. Check with ls -leO@ Python.recipies.handbooks.pdf. Jan 13, 2017 at 10:20
  • Who is the owner of the Downloads folder? Can you move the files from Downloads to somewhere else (without entering the password), does it work then? Does it help if you run chown karim FILENAME (yes, I know, sounds crazy)?
    – nohillside
    Jan 13, 2017 at 11:50
  • @GordonDavisson I did what you wrote. I update the question Jan 14, 2017 at 2:36

2 Answers 2

6

It looks like those files are coming from a Time Machine backup, and still have the don't-mess-up-the-backup access control ("group:everyone deny write,delete,append,writeattr,writeextattr,chown") attached. You can remove this with e.g.

chmod -N Python.recipies.handbooks.pdf

You might also want to remove the stray extended attributes with

xattr -c Python.recipies.handbooks.pdf
1
  • Wow, I didn't know about the -N flag to chmod. Thanks!
    – hlynbech
    Jan 14, 2017 at 20:00
-2

On the macOS HFS+ filesystem, there are other attributes beyond the standard permissions and ownership. See thie answer: https://stackoverflow.com/questions/4833052/how-do-i-remove-the-extended-attributes-on-a-file-in-mac-os-x

2
  • xattr -rc Python.recipes.handbooks.pdf xattr: [Errno 13] Permission denied: 'Python.recipes.handbooks.pdf' Jan 14, 2017 at 2:40
  • Answers on Ask Different need to be more than just a link. It's okay to include a link, but please summarize or excerpt it in the answer. The idea is to make the answer stand alone.
    – nohillside
    Jan 14, 2017 at 8:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .