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

moveSync copies and deletes dirs on external drives #608

Closed
garyking opened this issue Aug 3, 2018 · 3 comments · Fixed by #667
Closed

moveSync copies and deletes dirs on external drives #608

garyking opened this issue Aug 3, 2018 · 3 comments · Fixed by #667
Assignees
Milestone

Comments

@garyking
Copy link

garyking commented Aug 3, 2018

  • Operating System: macOS 10.13.5 (17F77)
  • Node.js version: v8.11.2
  • fs-extra version: 7.0.0

I'm using moveSync to rename a big folder on an external drive. The folder is about 2 GB. It seems like moveSync copies the folder then deletes the original, rather than simply renaming the folder, since it takes a few minutes to finish.

I thought that it was supposed to use rename under the hood, but it seems like that's not the case for me, since when I replace moveSync with renameSync, the rename is instant.

The path to the folder I'm renaming is /Volumes/Data/Test/One, if it matters.

@RyanZim
Copy link
Collaborator

RyanZim commented Aug 3, 2018

@garyking move falls back to copy-and-delete if rename fails. Not sure why it failed in this case, though.

@manidlou
Copy link
Collaborator

manidlou commented Aug 4, 2018

hmm.. @RyanZim we updated move implementation to use rename as the main operation but somehow we forgot to update the moveSync implementation! I kind of blame myself on that as I was supposed to do that! I will be working on updating moveSync this weekend.

In the meantime, @garyking in order to be a little ahead of ourselves, will you please try your code with move() and tell us if it works?!

@manidlou manidlou changed the title move copies and deletes dirs on external drives moveSync copies and deletes dirs on external drives Aug 4, 2018
@manidlou manidlou self-assigned this Aug 4, 2018
@garyking
Copy link
Author

garyking commented Aug 4, 2018

I can confirm that moveSync copies then deletes the old file (therefore taking a few minutes on a big file), whereas move is an instant rename.

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

Successfully merging a pull request may close this issue.

3 participants