So I'm setting myself up with a non-admin account on OS X, which
involves chowning a bunch of stuff.
$ cd $DIR; sudo chown -R jjuran:jjuran .
chown: ./path/to/files/foo.cp: Operation not permitted
chown: ./path/to/files/bar.cp: Operation not permitted
chown: ./path/to/files/baz.cp: Operation not permitted
Um, what? I'm ROOT. There's nothing I can't do. WTF?
Viewing the files in the Finder makes everything clear. They're locked.
Now, you see, locked (in Mac OS) is not the same as read-only (in
Unix). Read-only means only that you can't write to a file -- you
can still rename it or delete as long as you have write privileges to
the parent directory. But a locked file can't be renamed or deleted
until the lock is removed.
I thought I understood this -- that you get the semantics of
whichever filing system whose API you call. FSpOpenDF() or FSpDelete
() might return a file busy error, but open() and unlink() won't.[1]
But I was wrong. Even using BSD's POSIX layer, even *as root*, the
Locked attribute wins.
Apparently, Mac OS X is not Unix.
Josh
[1] With the possible exception of mandatory locks, but you still
have to opt in.