Skip to content

the mv command takes a long time even if the src and dest on same device. #6029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hamflx opened this issue Feb 29, 2024 · 3 comments · Fixed by #6040
Closed

the mv command takes a long time even if the src and dest on same device. #6029

hamflx opened this issue Feb 29, 2024 · 3 comments · Fixed by #6040
Labels

Comments

@hamflx
Copy link
Contributor

hamflx commented Feb 29, 2024

see

reproduce:

  • clone a large front-end project, on Windows
  • npm install
  • cd node_modules to simulate a file being locked by a process
  • Open a new shell.
  • Run mv node_modules \.nd This command will take a long time and then fail.

is possible to change the fallback to copy only when the std::fs::rename report an ERROR_NOT_SAME_DEVICE/EXDEV error? this will failed immediately rather than takes a long time and then failed.

now it always trying to copy, even if it just an permission error, this takes a long time, and then failed again.

@hamflx
Copy link
Contributor Author

hamflx commented Mar 1, 2024

@tertsdiepraam
Copy link
Member

Sounds interesting to explore at least. Could you open a PR with that diff?

@hamflx
Copy link
Contributor Author

hamflx commented Mar 2, 2024

@tertsdiepraam I have created a pr. but i'm not sure if my changes have side effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants