How to avoid file being use by another process while moving

Hi Everyone,

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.

Thanks

Hi @suraj_gaikwad

What is that file? Which application it is being used by when you are trying move operation?

Are you doing some steps in UiPath workflow itself before move operation which is using this file?

Hey @sonaliaggarwal47

Before move file uploading the same file and appending some data.

But that file still locked on upload server. File is txt format

Thanks

@suraj_gaikwad,

Use retry scope for this with decent amount of interval between two retires and number of retries

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.

@ashokkarale

@suraj_gaikwad

Have you tried Increasing the number of retries?

Hi,

Yes did Even i did do while but it’s taking to much time to move.

@sonaliaggarwal47

@ashokkarale

Thanks

@suraj_gaikwad

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?

@suraj_gaikwad,

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.

This will save your waiting time.

Yes, but even I can’t delete because its already being use by another.

@ashokkarale

Yes, even i kill after append using kill activity

@sonaliaggarwal47

@suraj_gaikwad,

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.

I didn’t get you. Could please elaborate?

Every transaction is different file

@ashokkarale

Hi Suraj,

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 ?

Actually where I’m uploading file there showing upload successful but in backend that file is in process bcz of that not able to move that file.

Is there any way to move if that error occurred.

@Bastien_B

@sonaliaggarwal47

@ashokkarale

Thanks

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 ?

Yes, i have. Once file upload closing that child page where uploading.

@Bastien_B

Thanks

So, just to make sure I understand, your other process only releases the file once whatever it uploads is done and has it locked until then ?

Yes , file is uploading and closing that poo also but still its using at backend

Thanks

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,