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.
to see flags:
basically, if you see one listed, call chflags and add "no" before the flag name to remove it.
chflags noopaque file
chflags nouappnd file
recursively set flags to 0 on all files and subdirectories.
this is garbage like com.apple.FinderInfo and the "quarantine" thing
kill it with fire:
supposedly -c will just clear them all, but on Snow Leopard I get invalid flag so have to do 'em all manually.
xattr -d com.apple.FinderInfo *