Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wait for a file in directory
#5
If you download it with IntGetFile from other thread, you can use global variable.

int+ g_downloaded=0
IntGetFile ...
g_downloaded=1

in other thread wait until g_downloaded is 1.
int+ g_downloaded
wait 0 V g_downloaded

-----------------------------------

This is more universal code. Works with files downloaded with QM, Internet Explorer, Firefox, etc.

Function wait_file
Code:
Copy      Help
str s="D:\downloads\quickmac.exe"

Dir d
rep
,if d.dir(s) and d.FileSize
,,__HFile f.Create(s OPEN_EXISTING 0 FILE_SHARE_READ); err
,,if(f) f.Close; break
,0.5

mes "downloaded"

;info: the d.FileSize is for Firefox, which at first creates empty file, then downloads to other file...

test
Macro Macro1446
Code:
Copy      Help
str s="D:\downloads\quickmac.exe"
IntGetFile "http://www.quickmacros.com/quickmac.exe" s 16


Messages In This Thread

Forum Jump:


Users browsing this thread: 13 Guest(s)