Jump to content

winwait


AnuReddy
 Share

Recommended Posts

Hi,

depending how the download works:

1) If file size grows by time, just compare file size on source and target in a loop.

Do
    sleep (250)
Until FileGetSize ($target) >= FileGetSize ($source); you might use InetGetSize if you download from url

2) If you use another program for download, check with processexists in a loop if download is ready.

$pid = ProcessExists ("mydownload.exe") 
While $pid <> 0
    sleep (250)
    $pid = ProcessExists ("mydownload.exe")
WEnd

3) Try to open the file in read mode. If failure, wait.

$file = FileOpen ("myfile", 0)
While $file = - 1
    sleep (250)
    $file = FileOpen ("myfile", 0)
WEnd
FileClose ($file)

;-))

Stefan

Edited by 99ojo
Link to comment
Share on other sites

Hi,

depending how the download works:

1) If file size grows by time, just compare file size on source and target in a loop.

Do
    sleep (250)
Until FileGetSize ($target) >= FileGetSize ($source); you might use InetGetSize if you download from url

2) If you use another program for download, check with processexists in a loop if download is ready.

$pid = ProcessExists ("mydownload.exe") 
While $pid <> 0
    sleep (250)
    $pid = ProcessExists ("mydownload.exe")
WEnd

3) Try to open the file in read mode. If failure, wait.

$file = FileOpen ("myfile", 0)
While $file = - 1
    sleep (250)
    $file = FileOpen ("myfile", 0)
WEnd
FileClose ($file)

;-))

Stefan

hey thanks stefan :mellow::)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...