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?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
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:
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: