I'm jotting down some notes for future reference as I work through fixing a bunch of file permission problems on my HFS+ partition. These are files that I've created while in Ubuntu - I store a lot of my data on the HFS+ partition on my Macbook, and edit files from either OS depending on particular needs. Most of the time this works flawlessly. But once in a while I get a bunch of files that are fine in Ubuntu but in OSX are locked, unchangeable, undelete-able, and which I can't do anything with even after unlocking them in the Finder, using sudo, etc.


Aside from the basic UID/GID matchup tricks, OSX apparently has a whole bagful of secret ways to make files inaccessible. These include ACL's, extended attributes, and "flags", all of which need different command line tools.

Flags:

to see flags:
Code:
ls -lO
Handy ref:
http://mac101.net/content/tips-trick...ers-at-once/#1

examples:
Code:
chflags noopaque file
chflags nouappnd file
basically, if you see one listed, call chflags and add "no" before the flag name to remove it.

or just

Code:
chflags -R 0 *
recursively set flags to 0 on all files and subdirectories.

Extended Attributes:

this is garbage like com.apple.FinderInfo and the "quarantine" thing


list them:

Code:
ls -l@
kill it with fire:
Code:
xattr -d com.apple.FinderInfo *
supposedly -c will just clear them all, but on Snow Leopard I get invalid flag so have to do 'em all manually.