Dear Aunt TUAW: What are those lockfiles?
Dear Aunt TUAW,
With Lion, I'm seeing a lot of plist.lockfile in my Preferences folder. I'm assuming the "lockfile" business has to do with the new autosave stuff in Lion, but why would that apply to a preference file? Is this a bug or a feature?
Your loving nephew,
Darren

Dear Darren,
Feature.
Historically, lock files have restricted file access to one application at a time. Auntie has no reason to think that Lion's use of this concept differs. A lock file prevents a second edit from being applied concurrently, preserving information integrity.
Access control is especially important when competing processes might want to update an application's defaults at once.
Auntie went ahead and used opensnoop to watch what happened as she updated a few preferences. Sure enough, the lock file seemed to be set on application launch and reset on quit
% sudo opensnoop -f ~/Library/Preferences/com.apple.TextEdit.plist
UID PID COMM FD PATH
501 23363 mdworker 6 /Users/ericasadun/Library/Preferences/com.apple.TextEdit.plist
501 23363 mdworker 7 /Users/ericasadun/Library/Preferences/com.apple.TextEdit.plist
What surprised Auntie was how if she didn't identify a specific preference to watch, that all the preferences lockfiles were refreshed whenever a new lock was applied (Try it yourself, with sudo opensnoop with no arguments).
It was also fun to see how TextEdit updated its autosave information, its saved state, its shared file property list and more. Opensnoop is curiousity crack.
Hope this helps! Love & snuggles,
Auntie T.
Share
Source: http://tuaw.com/tag/aunttuaw
Categories
Dear Aunt TUAW, With Lion, I'm seeing a lot of plist.lockfile in my Preferences folder. I'm assuming the "lockfile" business has to do...
Add a Comment
I learn something every day reading this site. Thanks for mentioning opensnoop; I had no idea it was there!
August 16 2011 at 12:30 PM Report abuse Permalink rate up rate down ReplyDeals of the Day
more deals- Acoustic Research Digital Photo Frame with iPod Dock for $50 + free shipping
- Apple iPhone 4 8GB for Verizon, AT&T, or Sprint for $50 + pickup at Best Buy
- Unlocked iPhone 4S 16GB for GSM (AT&T, T-Mobile) for $619 + free shipping
- Apple iMac Core i7 Quad 3.4GHz 27" w/ 24GB RAM, 2TB HDD for $2,677 + $29 s&h
- Used Apple Magic Mouse for $36 + $4 s&h
- Skullcandy Riot Earbud Headphones for $10 + free shipping
1 Comment