2

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?

2 Answers 2

2

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.

1
  • I guess the synchronization utility runs under the same user account I am logged in, and I cannot write-protect the file without to make it read-only for me too.
    – apaderno
    Mar 29, 2011 at 21:12
0

I found that removing write permission from some preference files is insufficient, since write permission needs to be enabled on ~/Library/Preferences to change almost every preference there is. Write permission on a folder means you can delete any file within it, even those owned by another user & read-only to you. A lot of programs update files in what they call an "atomic" fashion, which in practical terms means they write the new file under another name, delete the original, & rename the new file to the old file's name. The Dock is one such program—setting com.apple.dock.plist to read-only doesn't stop it updating.

To get around this is thankfully rather simple: set the file's "Locked" attribute. Cmd+I in the Finder will get you a checkbox to check, & if you prefer using the Terminal the commands for locking & unlocking a file are:

chflags uchange the_file     # to lock the_file
chflags nouchange the_file   # to unlock the_file

...where uchange can be replaced with uchg or uimmutable.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .