Jump to content

Recommended Posts

Posted

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?

Posted

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..

Posted

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.

  • 2 weeks later...
Posted

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.

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...