Wait for a file existence

Started by archimede, July 01, 2022, 09:08:43 AM

Previous topic - Next topic

archimede

Hallo
I need to wait for a file existence.
I tested FileExist(...) like
While !FileExist("File.txt")
EndWhile
it works, but it is hard because continue to unuseful cycle.
Is it possible to stop the program flux until a file will exist?
Is it possible to define a generic name ( like "*t?.txt" ), not only a specific name?

Thank you very much

JTaylor

Can you restate things a bit.  Not sure what you mean by

it works, but it is hard because continue to unuseful cycle.
Is it possible to stop the program flux until a file will exist?


If you mean the While loop halting further activity being the issue and you want to do other stuff, if you have a dynamic dialog in use you could use the Timer event.


Jim

td

1. FileExist does not support file name masks.

2. Use the TimeDelay function to suspend a script for some period of time in between file existence checks.

3. If you wish to check for the existence of one or more files by file name masks use FileItemize or a similar function and see 2 above.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade