Stalker0 Posted September 17, 2007 Posted September 17, 2007 I'm running a script that involves copying a file, and the script needs to wait until the file is finished copying before it continues. I'm looking for ways to determine when the file stops copying. My current idea is to run a loop which checks the file size every 5 seconds or so, if the size is unchanged, the program assumes the file is done. Does anyone know a better way to do this?
Zedna Posted September 17, 2007 Posted September 17, 2007 Depends on method of copying. Post your code snipet. Resources UDF ResourcesEx UDF AutoIt Forum Search
lordofthestrings Posted September 17, 2007 Posted September 17, 2007 I would suggest: runwait() (with @comspec and @SW_HIDE macros) run a dos copy (or xcopy if you like) command from this runwait() then use adlibenable() to loop at the interval you specify (5 seconds) in this adlibenable function check with processexists() wether process CMD.EXE exists..
2TMax Posted September 17, 2007 Posted September 17, 2007 Why not use the exaple "Demonstrates StdoutRead()". It'll create a command console, executes a command, waits till it's ended. meanwhile it captures text sended to console. no needless looping, keeps track of processing and gives you the oppurtunity to act on failures/successes. Abit less complex is: check for the return value. '0' = Oke '1' to '4' = trouble Sorry for my poor English, I'm just a bloody forainer from the flat country called Nederland.
Stalker0 Posted September 25, 2007 Author Posted September 25, 2007 Why not use the exaple "Demonstrates StdoutRead()".It'll create a command console, executes a command, waits till it's ended. meanwhile it captures text sended to console.no needless looping, keeps track of processing and gives you the oppurtunity to act on failures/successes.Abit less complex is: check for the return value. '0' = Oke '1' to '4' = troubleWhere is this example located, I didn't see it in the standard autoit examples.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now