Skip to content

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

Closed

Description

@wmertens

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.'))

Activity

  1. manidlou commented on Mar 24, 2020

    @manidlou
    Collaborator

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

  2. wmertens commented on Mar 25, 2020

    @wmertens
    Author

    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?

  3. manidlou commented on May 7, 2020

    @manidlou
    Collaborator

    @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!
  4. added this to the 10.0.0 milestone on May 16, 2020
  5. added a commit that references this issue on Dec 23, 2025
    c8bd383
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions