Re: HOWTO check if file is completly copied - OS9
Re: HOWTO check if file is completly copied - OS9
- Subject: Re: HOWTO check if file is completly copied - OS9
- From: Bastiaan Boertien <email@hidden>
- Date: Wed, 9 Feb 2005 14:01:34 +0100
I have scripts like yours and it works with the duplicate command
I just modified the script a little
Normally I mount the volume, then let the user choose witch file needs to be modified from the server and then duplicate the file. After duplicate is finished then modify the file
here's how I copy the file over the network.
set afpVolume to "networkdisk"
set afpServer to "server"
set afpUser to "user"
set afpPassword to "password"
set afpFile to afpVolume & ":folder:subfolder:name.txt" as string
set destinationFolder to (path to desktop folder)
mount volume afpVolume on server afpServer as user name afpUser with password afpPassword
-- normally I let a user choose the file that needs to be copied from the mounted volume
tell application "Finder"
set theName to name of file afpFile
with timeout of 900 seconds
duplicate file afpFile to destinationFolder with replacing
end timeout
-- if you want to move,
-- duplicate te file and remove the file after duplicate
-- command after duplicate will not execute when duplicate is finished
eject disk afpVolume --older versions of applescript is the 'eject' command 'put away' like os9
end tell
try
set thefile to destinationFolder & theName as alias
on error
display dialog "duplication failed" buttons {"OK"} default button "ok" with icon stop -- with icon stop????? maybe a result in a error but not sure
return
end
--and the rest of the script
maybe this is where you looking for
greetings bastiaan
Op 9-feb-05 om 12:46 heeft Brendan Wilde het volgende geschreven:
I need to make a script for OS9, a file need to be modified.
The file is being copied over the network.
So before doing something with the file, I need to check is the file
is complete!
Anyone a trick to do this thing?
I have a script that copies a file over a network then once it has finished copying it
moves the original file...
i did it by getting the size of original file
then repeatedly getting the size of the new file
until the size of new file is the same size as the size of the original file
this is not really a good way to do it, it probably hogs memory
but it works and i couldn't think of another way to do it...
_______________________________________________
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
_______________________________________________
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