Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
    
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. –  kiamlaluno Mar 29 '11 at 21:12

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.