Best way to tell if a file copy has finished.
Best way to tell if a file copy has finished.
- Subject: Best way to tell if a file copy has finished.
- From: email@hidden
- Date: Tue, 2 Aug 2005 21:58:17 +1000
I have a script that must process files that appear in a folder, they are copied there from another mac across the network. I've seen a couple of methods for this in scripts I've found on the web. I did have one method that seemed to work well under Panther but it doesn't work under Tiger.
One method was to loop trying to move the file to another folder. Under Panther the move would fail until after the file had finished copying. Under Tiger the move succeeds resulting in a truncated file.
Another method was to loop testing the size of the file and not process it until the size stopped changing.
set the item_size to the size of (info for this_item) repeat while item_size is not equal to the size of (info for this_item) set the item_size to the size of (info for this_item) delay 2 end repeat
Under Tiger I have found that the file size remains at zero until the file has finished copying, so my script now loops while the file size is zero.
Does anyone have a better method that works on Tiger?
Thanks JZ
|
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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