Re: How to tell if a file is busy?
Re: How to tell if a file is busy?
- Subject: Re: How to tell if a file is busy?
- From: David Simerly <email@hidden>
- Date: Wed, 26 Sep 2001 08:30:54 -0700
- Url: http://www.digital-native.com
on 9/25/01 11:59 PM, Simon Forster at email@hidden wrote:
>
I've found out that the Busy flag is not reliable the hard way. As a
>
work around, I try opening the file to read it and trap any error
>
returned but there must be a better way no?
Simon:
I've found the Busy flag to be very reliable during file copies, moves, and
other operations conducted by the Finder. In fact, if you look at the Folder
Action script examples from Apple, it's used quite a bit to determine when
the Finder has completed file access and it's safe for the script to
proceed. The problem is that the flag is virtually useless if no app other
than the Finder makes use of it. This wouldn't be a problem if the flag was
set and unset at the system level, but my understanding of its operation is
that each application is responsible for handling it, and most don't.
I've used your "open for access" method on occasion too. It works 80-90% of
the time, but then you run into an app like BBEdit which load its documents
entirely into memory so the file itself doesn't stay open. In those cases
one is able to "open for access" the file with no problems. So there's no
perfect solution TIKO. HTH.
DS
______________________________________
Digital Native
Your guide through the virtual jungle.
______________________________________
"Twenty years from now you will be more disappointed by the things you
didn't do than by the ones you did. So throw off the bowlines. Sail away
from the safe harbor. Catch the trade winds in your sails. Explore. Dream.
Discover." -- Mark Twain