Re: Busy Status
Re: Busy Status
- Subject: Re: Busy Status
- From: Emmanuel <email@hidden>
- Date: Mon, 4 Nov 2002 00:36:40 +0100
At 11:33 PM -0500 02/11/02, Rob Jorgensen wrote:
At 7:55 PM -0800 11/2/02, Jon Pugh wrote:
At 6:26 PM -0500 11/2/02, Rob Jorgensen wrote:
I guess Jon's 'fileIsBusy' hasn't made it to X but I mention just in case.
Yep, it's in the OS X version (thanks for the nudge) but it
doesn't work either (not the way I want it to anyway). ;-)
According to the description, it tells whether or not a file is
open. Based on my tests with Jon's Commands, Standard Additions
and the Finder, a file that is in the process of being downloaded
presents a challenge when trying to determine its busy status.
<shrug>
OSX changes the way files are shared. No longer does have having a
file open for write access prevent another process from opening it
for write access, which prevents this command from working. I'm
looking into what it would take to fix this, but I haven't found
anything worth implementing yet, and if I don't, I'll probably just
remove the command.
Thanks for confirming this seemingly hazardous situation. Just today
I noticed that a script could write to a file that was already open
in TextEdit but I didn't push it to see what would happen if I
edited and saved the file with TE while the script was writing. It
seems that no good could come from it and I wonder how to prevent
problems in the rare cases where this might occur.
The programmer's concern here is not to protect you against your
acts, but against his program's failures. Letting a file open while
you crash is not cool. Such has been the case of some apps in the
beginnings of the Mac, but today many programmers prefer to open the
file only while actually writing to it. (Many exceptions, e.g. in the
data bases world).
If such is the case of the program which downloads your files, the
files are just normal most of the time: only the app knows that they
are not in their final state. There is just no way to know if they
are busy except testing their size periodically.
Under OS9, start downloading a file, force-quit the downloading app,
then test whether the file is open by attempting to open it with
write permission. I bet most of the times you can.
Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.