I’m trying to move file but that same file using in another process, i won’t use copy i just wanted to move only but it’s taking too much time to unblock the file from the application how can i handle this scenario. If the error come still bot should move the file after error also.
Yes, actually theres are multiple files to upload and i use retry as well as do while.
Bit moving files within three to four time but sometimes it’s taking to much time to move bcz it’s already locked in another application. Bc of this its an delay to complete the automation.
So, sometime, its moving after 3-4 times, but sometimes its taking longer to move, right?
if yes, I think thats okay only as sometimes can be the case that data you are appending to the file is more in size so it being locked for more time than usual?
Hmm..In that case what you can do is just copy the file instead of moving at first time. In later run or transactions just try to delete the older files.
What I meant was delete this file in initialization or some other state to clean the folder later on whenever it will be free from use. It could in one hour/day.
If you want your file to not be used while you move it, maybe you could use an asset that you set as the one that needs to be moved, so that before using the file, other processes check for that asset and wait for it to be moved before using the next file ?
Do you have access to the behavior of the other process using your file ? And if so, does it need the file to be locked in use during the whole process ?
So then you could make it so the other process to actually fully release the file or use a specific asset that gives the files that are being uploaded and thus cannot be moved and have your process only work on those that aren’t busy on the upload.
Another way of doing it would be to get the treatment done in one process and the moving in another one which will move all files that have been treated and are finished being uploaded.
Sincerely,