Page 1 of 1

Wait for file doesn't wait

Posted: Sat Nov 14, 2015 6:45 pm
by marcolobaido
Hi, I have to convert a file to a rar archive and then to do some actions, so I use the Wait for file action and I set 10 seconds but the task immediately stops because of:

E: 14/11/15 18:34:11: File ""C:\Users\Lo Baido\Dropbox\Cartsan\documenti\Mediwork sas\2015\1 Documentazione Sanitaria Mediwork sas 2015.rar"" doesn't exist
E: 14/11/15 18:34:11: An error occurred. Step #36 (Waiting 1 Documentazione Sanitaria {DENOMINAZIONE} {Year}.rar" file for 10 sec).
E: 14/11/15 18:34:11: Task execution is aborted

I set the waiting time to infinite but the problem remains the same. Why? :|

Re: Wait for file doesn't wait

Posted: Sun Nov 15, 2015 8:09 am
by Oleg
This error means that file doesn't exist.
Winrar application creates the archive file after several seconds after beginning.
It seems RAR file doesn't exist when the action "Wait For File" begins to work. So put some pause (several seconds) before this action.

Re: Wait for file doesn't wait

Posted: Sun Nov 15, 2015 11:52 am
by marcolobaido
So why the action is called "wait for file"?

Re: Wait for file doesn't wait

Posted: Mon Nov 16, 2015 10:29 am
by Oleg
Read more about action here:
"Pauses the task and waits until the selected file will be available. After the monitored file is been available, the task is resumed. If the specified file is not opened in another process at the moment when the action is due, the task is not paused."

When file doesn't exist then the action raises the error "File is not found"

If you want to check file existence use {FileExists(<Filename>)} expression

For example:

Code: Select all

while {FileExists(c:\MyFile.txt)} = false
   pause 0.5 sec 
end loop
This construction waits until the file will appear.