MacOS – How to protect a preference file

macospreferences

I use Mobile Me to synchronize the settings of three different Macs, but I have some problems with specific preference file because one of the Macs runs Mac OS X Lion.

I would like to avoid that specific preference file is overwritten in the Mac running Mac OS X Lion. How can I do that?

Best Answer

You want to remove "write permission" from the file, so it cannot be written to. If you block MobileMe from writing to it, you will also be blocking the application from writing to it, which could cause problems.

Via the command line:

chmod u-w file.plist # u-w means "Remove Write from User"
chmod u+w file.plist # Undo: add user write permissions back again

From the Finder, do CMD+I (Get Info), and under "Sharing & Permissions" at the bottom, set it to read only.

If you need to write to the file (perhaps for the application to work properly), you can temporarily make it write-able, or approach this with a different solution. For example, you could use DropBox, link the file to DropBox from all your Snow Leopard computers, and just not link the file on the Lion computer.