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

Cannot move file to change case on case insensitive fs #759

Closed
wmertens opened this issue Feb 11, 2020 · 3 comments
Closed

Cannot move file to change case on case insensitive fs #759

wmertens opened this issue Feb 11, 2020 · 3 comments
Assignees
Milestone

Comments

@wmertens
Copy link

@wmertens wmertens commented Feb 11, 2020

When calling move() it checks if the destination exists, and if it does it refuses to call rename. This means you can't change the case on a case-insensitive file system.

Fs-extra should check that the destination has the same inode before refusing to move.

if (destExists) return cb(new Error('dest already exists.'))

@manidlou
Copy link
Collaborator

@manidlou manidlou commented Mar 24, 2020

@wmertens can you provide us with repro test case please?

@wmertens
Copy link
Author

@wmertens wmertens commented Mar 25, 2020

The test itself is really simple: try to rename a file from lowercase to uppercase, it will fail when executed on a case-insensitive fs. The question is, can your test suite simulate that?

@manidlou
Copy link
Collaborator

@manidlou manidlou commented May 7, 2020

@wmertens I finally found some time to dig into your case! So here is what I found:

  1. I appreciate if you would respect our issue template and respond to 3 simple questions that would help us resolve YOUR issue faster!
  2. If you are using the latest version of fs-extra, we actually check the inodes of src and dest (as well as other properties) to determine if src and dest are the same before moving! However I just realized that implementation doesn't support cases like yours (when you want to just change the case) and I am working on that!
  3. We actually have a test file for cases like this, however again I just realized that those tests are broken for case-insensitive systems! Currently for case-insensitive systems those tests expect an error thrown however the corect behavior should allow users change the case for case-insensitive systems! and I am working on that too!

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

Successfully merging a pull request may close this issue.

3 participants