-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
mv: fallback to copy only if source and destination are on a different device #7152
Conversation
GNU testsuite comparison:
|
GNU testsuite comparison:
|
Hm the test is failing because
on Windows. I don't work on Windows so this will be too hard for me to debug. I'll close this for now. |
@jfinkels you can just ignore the test on Windows with a comment :) |
Okay, I can do that and open a new issue for it |
GNU testsuite comparison:
|
00e3085
to
64879e2
Compare
GNU testsuite comparison:
|
6b2477d
to
c242b86
Compare
GNU testsuite comparison:
|
GNU testsuite comparison:
|
17efece
to
f1f2be9
Compare
GNU testsuite comparison:
|
I think this error should not be ignored. It occurs because the file is opened, leading to this error. However, if we fallback to the copy-and-delete logic, the move can succeed. In other words, on Windows, when a file is opened, MoveFile will fail with the error "Access is denied," but DeleteFile can still be used. Determining whether deletion is possible under "Access is denied" scenarios will be challenging, which makes it difficult to proceed with this PR. |
A file on Windows can exist in the following two states:
My previous PR overlooked the first case. Before merging the PR, we need to find a way to distinguish between these two scenarios. |
The changes here cause the existing test
Better to just update the pull request from your branch. Thanks |
Make mv command fallback to copy only if the src and dst are on different device.
Fixes #6029
This is the same pull request #6040, I've just updated the Cargo.lock file.