BSD/MacOS question.
chmod -w file will remove all the write permissions from file
chflags uchg file will set the user-immutable bit (aka "Locked" bit) on file
Beyond the obvious statement of "setting permissions vs setting a flag", what are the technical differences and behavior differences of these two commands? When is one preferred over the other?