>Erik,
> thanks for your reply. Basically, this external program is EXPEDITE for Windows by IBM. We use it to transfer and receive files from the IBM Advantis system. This software creates a log for which my program can wait, but this cannot work because the EXPEDITE sw creates the file rightaway as soon as it is the sw is executes and we don't want to open the file till the entire transfer is done or else we will have file open errors.
It can wait. The trick is that if any program creates a file, its size is reported as zero as long as the program keeps the file open. So, in your fox routine, you launch Expedite, and create a loop like this:
do while .t.
n=adir(aFiles, "the_log.txt")
if n=0
* something wrong, can't find the file - exit or do something else
else
if aFiles[1,2]=0 && the length of file - see ADir function
* it's still working
wait "Processing... " time 5
else
wait clear
exit
endif
endif
enddo