$ cd ~/Library/Preferences
$ ls -1 | grep plist | head -10

what are these lockfiles for?


Apple supplies a Core Foundation Preference Services API to developers that makes it easy for them to manage preferences. Apple uses the same API and these lock files help the system know what programs are writing to the files and it helps the system notify the running program when a setting gets changed.

The system will keep track of a file that's open even if you trash and delete it, but it's probably best to leave these alone (like most of ~/Library) as there's no undo for things that are stored there - they are there to support the "undo" of the rest of the system.

| improve this answer | |

Lockfiles are used to make sure only one app interacts with a preference file at once. The idea is an app opens the lockfile in an exclusive mode while it opens the plist.


| improve this answer | |

Purely guesswork unfortunately, but typically lockfiles are there to stop a file being edited by more than one thing at a time and causing corruption.

However if you run fs_usage on your Mac to watch filesystem activity nothing much seems to touch these files. The Finder seems to read through them all occasionally but that seems to be it, even if you change preference settings in various applications.

| improve this answer | |
  • when you quit an app the lockfile isn't gone though. rm'd them all, them only seem to be recreated on app launch. Changing prefs for an app does not recreate them. – kch Aug 2 '11 at 1:46

Have you noticed if you can make settings changes to applications? I'm seeing these lockfiles also and preferences are not being saved to the plist files.

UPDATE: I discovered that a previous ACL was in place that prevented me from making changes to application settings. By removing the ACLs using chmod -R -N on my home folder I am now able to make changes that are saved.


| improve this answer | |

You must log in to answer this question.

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