Possible Duplicate:
ls -la symbolics… what does that last symbol mean?

Consider the following output from ls -l on OS X 10.5.8

drwxr-xr-x   3 user  staff    102 Aug 26 20:21 downloads
drwxrwxrwx@ 10 user  staff    340 Aug 26 20:12 images

Can anybody tell me what the @ represents at the end of the permissions section, and also how to disable/enable it. I guess this this has something to do with the directory listing permissions, as when I'm running a PHP script in Apache that needs to access a folder without the @ bit set, it doesn't list the directory contents.

Thanks!

link|improve this question
feedback

migrated from stackoverflow.com Aug 26 '09 at 21:18

This question came from our site for professional and enthusiast programmers.

closed as exact duplicate by Gnoupi Jul 14 '10 at 18:21

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

2 Answers

Off the top of my head, I think is has something to do with the file having extended attributes available. Here's a link to a similar discussion:

http://discussions.apple.com/thread.jspa?messageID=5791060

So if you see a file with an "@" when you do an ls, try doing this:

xattr -l <filename>

That should show you the extended attributes.

You can check xattr's help for more details:

xattr --help
usage: xattr [-l] file [file ...]
       xattr -p [-l] attr_name file [file ...]
       xattr -w attr_name attr_value file [file ...]
       xattr -d attr_name file [file ...]

The first form lists the names of all xattrs on the given file(s).
The second form (-p) prints the value of the xattr attr_name.
The third form (-w) sets the value of the xattr attr_name to attr_value.
The fourth form (-d) deletes the xattr attr_name.

options:
  -h: print this help
  -l: print long format (attr_name: attr_value)

It seems like if you look at the extra attributes with "-l" and then remove them with "-d" it'll probably do what you want. Practice this in a temporary directory somewhere first though and make sure it works ;)

link|improve this answer
Thanks a lot! It would seem that the directory in question was marked as com.apple.quarantine, which is a security measure to protect against dodgy scripts and apps from the net. That can't possibly cause the problem of the directory not listing. :/ I'll look around more and post the solution if I find it. – Constant M Aug 26 '09 at 20:17
feedback

From the man page of ls:

The Long Format
[…] If the file or directory has extended attributes, the permissions field printed by the -l option is followed by a '@' character. […]

link|improve this answer
nope. it's for extended attributes. – Stefano Borini Aug 26 '09 at 20:10
@Stefano Borini: You’re right. Corrected it. I would have deleted by answer but you cannot delete an accepted answer. – Gumbo Aug 26 '09 at 20:24
Note that the '@' can also hide the '+' that would normally be there to indicate that the file/directory has an ACL associated with it. Try 'ls -le@O' -- that'll list xattrs, ACL (if present), and also any flags. – Gordon Davisson Aug 26 '09 at 20:32
feedback