Jump to content

Determining the End of a File Copy


Recommended Posts

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?

Link to post
Share on other sites

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.

Link to post
Share on other sites
  • 2 weeks later...

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

Where is this example located, I didn't see it in the standard autoit examples.

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...