Skip to content
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

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

Open
hamflx opened this issue Feb 29, 2024 · 3 comments · May be fixed by #6040 or #7152
Open

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 · May be fixed by #6040 or #7152
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.

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