Wait for file doesn't wait

Discuss RoboTask here
Post Reply
marcolobaido
Posts: 70
Joined: Thu Jul 02, 2015 3:54 pm

Wait for file doesn't wait

Post 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? :|
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Wait for file doesn't wait

Post 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.
Oleg Yershov
marcolobaido
Posts: 70
Joined: Thu Jul 02, 2015 3:54 pm

Re: Wait for file doesn't wait

Post by marcolobaido »

So why the action is called "wait for file"?
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Wait for file doesn't wait

Post 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.
Oleg Yershov
Post Reply