Re: File Busy
Re: File Busy
- Subject: Re: File Busy
- From: Chris Page <email@hidden>
- Date: Wed, 4 Oct 2006 05:44:54 -0700
[Replying to an old post I just noticed.]
On Jul 17, 2006, at 10:35 AM, Jon Pugh wrote:
At 9:13 PM -0300 7/15/06, Adam Bell wrote:
Jon's Commands "fileIsBusy" uniformly returns false for the
simple reason, I assume, that the "busy status" in the properties
of a file remains "false" even if you attempt to change it to true
(which does not cause an error) and when the file is open in
another application.
Jon's Commands' "fileIsBusy" command no longer works in Unix-land
because Unix allows multiple people to write to a file at the same
time. They each create a different version of the file and the
last one to write to it wins.
I'm a little surprised if File Manager doesn't set the "busy" flag to
true when it opens a file.
This may be more than you wanted to know, but:
By default, you can open any file you have permission for. There is
also a facility called "advisory locking", which allows multiple
processes to coordinate on accessing a file. However, a lock does not
prevent other process from opening the same file unless they too use
an advisory lock.
<x-man-page://2/flock>
The Carbon File Manager implements the older Mac OS 9 semantics using
advisory locks. This means you can tell if a file is currently opened
using explicit advisory locking or--indirectly--if it's been opened
by the File Manager, which may (or may not) be useful depending on
your application.
Also, you can discover whether a file is open at all--with or without
an advisory lock--with the "lsof" command, but it's not a good
general solution for most applications.
<x-man-page://8/lsof>
--
Chris Page - Software Wrangler
That’s “Chris” with a silent *and* invisible “3”.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden