Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What are the .lockfiles (for example, in ~/Library/Preferences) in OS X Lion for? I didn't seem to see them in Snow Leopard. Do they impact modifying other files in any way?

And how do you open these lockfiles?

share|improve this question

Lockfiles are used to restrict editing of another file (ostensibly a document or resource) while an application has said document or resource open. This is so that only one application can write to a file at a given time.

You cannot open a lockfile, nor would you as the user ever need to. On some systems, they are empty files, and so there's nothing to see anyways. The exact implementation on OSX Lion is described here:

share|improve this answer

I believe it is actually more related to the built in version control thats new in Lion. Its probably the most recent snapshot of the file. That's probably why they hid the library folder by default in this release. John Siracusa explains the internals in great detail here in his review on Ars Technica:

share|improve this answer
The built in version control may be why it's there, but from what I read (I unfortunately don't have the time right now to read the whole section), I'm still inclined to say that the lockfiles are being used for their traditional purpose. Having 2 apps reading the same file is fine, but having 2 apps writing to the same file is dangerous. – MBraedley Jul 26 '11 at 11:14

Your Answer


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.