Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cp: copyFileSync: could not write to dest file (code=EBUSY)

I have an issue using the copy task in https://www.visualstudio.com/docs/build/steps/utility/copy-files My task failed with an error cp: copyFileSync: could not write to dest file (code=EBUSY): ...

Looking up, I found out that somehow the file couldn't be overridden. When I delete that file and queue the build again, it succeeded.

Is there any permanent solution for this issue? I don't want to use the option "Clean target folder" in the copy task because in that folder there will be additional files that are not copied by the build task.

like image 378
LxL Avatar asked Feb 11 '26 13:02

LxL


1 Answers

According to the error message, the file is being used when the copy files task is running. You need to check which application is using it and make sure the application is closed when the task running. If the file is locked by any application, you may get "rm: could not remove the file (code EBUSY):..." error message even if you use the "Clean target folder" option.

like image 160
Eddie Chen - MSFT Avatar answered Feb 14 '26 13:02

Eddie Chen - MSFT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!