Extended Attributes
rm しようとしたらパーミションがないと怒られるファイルやディレクトリがあった。
$ ls -l
drwx------+ 2 jun _lpoperator 68 4 22 18:14 Desktop/
-rw-r--r--@ 1 jun _lpoperator 331778 2 16 2010 slide.key
末尾の +やら@やらは何だろうとman lsで調べたらこう書いてあった。
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 (such as an access control list), the permissions field printed by the -l option is followed by a ‘+’ character.
要は, @はMac OS Xでの拡張属性が, +は拡張セキュリティ情報(ACL等)が設定されていることを示すらしい。
拡張属性の情報はls -l@とかxattr -lで表示でき,man attrによると特定の属性の削除は
xattr -d <attr_name> <filename>
全ての属性の削除は
xattr -c <filename>
でできる。
拡張セキュリティ情報はsetfaclで変更かと思いきや,Mac OS Xではchmodを使うらしい。ACLsの消去は
chmod -N <filename>
でできる。