-
Notifications
You must be signed in to change notification settings - Fork 775
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
Move fails with EPERM when destination is in root of drive #819
Comments
Huh, that's a bug; looks like we need to either check if the parent is root, or else have proper handling of an node-fs-extra/lib/move/move.js Line 24 in 96facaa
@manidlou what's your preference? |
That's actually documented (https://nodejs.org/api/fs.html#fs_fs_mkdir_path_options_callback). I would say we check the error, but if anyone thinks checking if parent is root is a better approach because of specific reasons, I am open to that! |
We will need to check for root either way most likely, because we can't consider all To be perfectly clear here, I'm not in favor of changing the way |
Interestingly enough, node-fs-extra/lib/copy/copy.js Lines 41 to 51 in 96facaa
Not sure if that's ideal, though. Anytime you use |
Is it enough to use |
@manidlou That's a good idea! It should work, though I'm not sure, we might need to do some slash normalization. |
hmm.. I actually just remembered that moving to the root would basically fail because of permission error (unless you run it with |
@manidlou it'd be perfectly fine to write a test that's skipped on all platforms other than Windows for this. Any progress here? |
@manidlou what's the status here? |
I'd like to ship v10 next week, looks like this will need to be pushed back. |
Sorry @RyanZim! been super busy! I plan to wrap this up this weekend. If I cannot manage to do that, we will leave it for v11. |
fs-extra
version: 9.0.1Moving a file or directory where the destination is in the root of a drive (e.g.
D:\filename
) causes the operation to fail, as the move function attempts to mkdir the root of the drive.Error is as follows:
The text was updated successfully, but these errors were encountered: