Re: R23's Osaxen Rant (or much too much ado about nihil)
Re: R23's Osaxen Rant (or much too much ado about nihil)
- Subject: Re: R23's Osaxen Rant (or much too much ado about nihil)
- From: Bill Briggs <email@hidden>
- Date: Sun, 28 Jan 2001 01:34:47 -0300
At 7:55 AM +1100 28/01/01, Peter Gort wrote:
> The notion here is that a time-consuming process like a Finder copy can run
in a background thread so that your script can do other things in the
meantime. This can be useful. It's one of the powerful features of Finder
scripting. If the only thing you happen to want to do is the copy, then just
run your custom delay handler until the copy is done. Using the Delay
command in a repeat loop in your delay handler allows the rest of your
machine to function in the meantime.
Bill, I must respectfully add to this. While the "bzy " mechanism exists,
it's essentially a workaround.
The other problem is that the "bzy " mechanism is not foolproof. It
may work for Finder copys, but for other things it can and does fail.
I don't have an exhaustive list yet of the instances in which it
fails (we're testing that), but here's an example of one that does
fail - miserably.
If you are downloading an MP3 file through Napster, and it's not
finished writing yet (even if you've just started), and you run a
script to get the file's type code, it's not "bzy ", it's "MP3 "!! If
you want to do something with that file after it's finished, then a
script using the "bzy "/delay handler to determine when to continue
is DOA. Ditto for downloads with Fetch (file type is "????" until the
download is finished).
Scratch that strategy as a universal cure. You need to pay attention
to what's happening with the tool you are using and build in the
delays that work in the context you have. Otherwise you'll get bitten.
- web