I need to import and process text files as they are copied to a folder. Some
files can be a few megs in size and I don't want to grab them until they are
copied completely. A coworker uses LEN(FILETOSTR('filename')) in a loop with
a 10 second WAIT and grabs the file when the size stays the same two times in
a row. Anybody know of a better solution?
Thanks, Gary Tucker

Re: How can I determine when a file has finished copying so I can by Bernhard

Bernhard
Tue Sep 14 06:41:38 CDT 2004

Hi Gary,

> A coworker uses LEN(FILETOSTR('filename')) in a loop with
> a 10 second WAIT and grabs the file when the size stays the same two times in
> a row. Anybody know of a better solution?

Have a look at the ADIR function. With its help you get a lot of infos about the
file without loading the entire file.

A more reliable way would be when the programm, that produces the file, after
completing the file, maybe creates a second file with the same name but a
different extension. Then you would just look for the second file. When it's
there, you know the main file is complete. But therefor you must be able to
change the producing programm.

Regards
Bernhard Sander