Fix error when `overwrite_all` option is set to true
dircpy still did not overwrite the files even though CopyBuilder::overwrite was set to true.
Hi! Thank you so much for the PR!
I've added a test here for a copy operation with overwrite set to true, but it passes: https://github.com/woelper/dircpy/blob/645889b819dc78deade6d7ef16aba0420b8e5d08/src/tests.rs#L80
Are you adding any other options? Could you please give an example where this fails, or perhaps add a failing test? On which operating system are you?
Hi there.
My code for using dircpy can be seen here: https://github.com/catuhana/nue/blob/failing-dircpy/src/types/node/release.rs#L73
Using CopyBuilder::overwrite option always throws this error without this PR. Other options, overwrite_if_newer and such, do not fail.
I'm on Ubuntu WSL.
Hi!
Could you try running the test in the dircpy repo with cargo test copy_overwrite and see if it fails for you please?
It would be great if you had a very simple case to reproduce the error as I would like to know the root cause. This could also be a permission issue or something else - from your error message it seems like the operation fails because the file exists - perhaps that is an issue which could be addressed differently.
Hi again.
The test case does not fail for me at all, but I've created a repository for reproducing my issue. It has two features, dircpy_upstream which uses this repo directly and fails, and dircpy_fork which uses my fork (this PR specifically) and works.
The first run is always a success, since the target directory does not exist yet, so please run it twice to see the error.
Amazing, I'll try that out!