2008/01/03

Leopard, 'ls -l' and extended attributes

Under OS X v10.5 the permissions column from ls -l contains extra characters which I haven't seen before.

$ ls -l
total 16
-rwxr--r--@ 1 me me 165 Jan 2 06:38 run_webalizer
-rw-r--r--@ 1 me me 0 Jan 3 10:04 run_webalizer.scpt
The man pages didn't say anything about these @ characters. Google was no help since it ignores punctuation characters like "@".

Eventually I realized that, since I had done an "upgrade" installation of Leopard, my man pages might be out of date. Indeed they are: Apple's online man pages explain @ and much else that's new in the ls command:
If the file or directory has extended attributes, the permissions field printed by the -l option is followed by a '@' character. Otherwise, if the file or directory has extended security information, the permissions field printed by the -l option is followed by a '+' character.


And
The following options are available:
-@ Display extended attribute keys and sizes in long (-l) output.


Ah, Bach. Look at some of the interesting tidbits revealed by -@:
$ ls -l@
total 16
-rwxr--r--@ 1 me me 165 Jan 2 06:38 run_webalizer
com.macromates.caret 33
-rw-r--r--@ 1 me me 0 Jan 3 10:04 run_webalizer.scpt
com.apple.FinderInfo 32
com.apple.ResourceFork 754
So that's how TextMate knows where to put the cursor when I re-open a file.

Now I just need to figure out how to get my man pages up to date.

1 comment: