Checking if a file has copied completly
Dave
dave at looktowindward.com
Wed Jun 6 04:55:23 EDT 2007
Hi,
I tried this but it doesn't work, RunRev doesn't return an error. I
then used the external module that I wrote to get around the 2 GB
File Size Limit and that works *if* I open it with permissions set to
"fsRdDenyPerm".
All the Best
Dave
On 30 May 2007, at 19:46, J. Landman Gay wrote:
> Dave wrote:
>> Hi,
>> The file size *may* work but as you say it's not very robust. One
>> thing I have noticed is that if you start to copy a big file (like
>> a .mov) and then before it's complete, double-click it so that
>> QuickTime Player is launched then you get a message saying the
>> file is being used by Mac OS X. If there was a way to perform the
>> same check that would probably do the trick.
>
> I think the OS sets the file flag as "busy" during a write (at
> least on Macs, and I assume on Windows too.) So all you should need
> to do is try opening the file and then check the result. If it's
> busy, you'll get the appropriate error. Keep trying until the file
> opens.
>
> You need to use the form "open file" rather than the URL syntax:
>
> open file <filepath>
> get the result
> if it is empty then
> -- whatever you need to do here
> end if
>
> Put that in a repeat loop or a repeating pending message that exits
> if the result is empty, or times out after a specified amount of time.
More information about the use-livecode
mailing list