Move File-activity does not wait until file has been moved

Apparently Move File-activity does not wait for files to be moved to destination folder before it continues to the next activity. This has caused occasional crashes for my robot.

My process moves a file from temp-folder to the final destination as the last action of Process.xaml and then as the first action after getting the next transaction in Main.xaml it first searches the temp-folder for any files and then deletes them one by one. Occasionally I noticed that the file was still present in the temp-folder when the activity searched for files in the folder, but when it started deleting the files the transfer was completed and Delete File crashed due to file not found or access denied.

I tested it with a simple Move File-activity and a message box as the next activity. Message box is always displayed before the file appears in the destination folder.

I would imagine the activity should have a built-in check for if the move was completed? Instead we now have to put a loop that checks if the destination path exists before continuing the process.

Has anyone experienced similar issues with other activities that continue the process even if the task has not yet been completed?

I have experienced this as well. Before letting your process continue, you can write a loop to wait for the path to be fully moved. However, I do think that the Delete File activity should not continue until the move is complete or have an option to choose what it does.

2 Likes