Re: Lion crashed by AppleScript
Re: Lion crashed by AppleScript
- Subject: Re: Lion crashed by AppleScript
- From: Shane Stanley <email@hidden>
- Date: Fri, 22 Jul 2011 19:55:48 +1000
- Thread-topic: Lion crashed by AppleScript
On 22/7/11 7:07 PM, "Emmanuel LEVY" <email@hidden> wrote:
> For me, most of the time preference files are read when the app opens, then
> again if you ask the app's preferences, and they are saved when you click
> "save" over a change.
>
I believe that in some cases they get updated (much) more often than that --
how often is one of those implementation details that can, and probably
does, change.
Are you suggesting the Dock only writes to its files when you shut down? Or
the Finder? Because I see the Finder's preferences file getting updated
regularly, and it looks to me that making changes to the Dock results in
changes to its plist file soon after.
(And yes, I wouldn't be surprised if Lion exacerbated the problem, with the
idea of apps that can be automatically quit at any time, and the way state
is saved. But I don't really know.)
> Of course if you're writing at the very same moment the file may get corrupt
> - usually it ends with the beginning of one version ending with the end of
> the other version. But this is highly unlikely, the window to collide would
> be less than 1/1000 second.
>
If you run a script regularly, what starts out as a slim possibility can
eventually become a strong probability. And if your script is both modifying
a plist file *and* changing properties of the application that would be
stored in that same plist file, then I don't see the possibility of a clash
being so improbable.
-- Shane Stanley <email@hidden> 'AppleScriptObjC Explored'
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden