Skip to content

File i/o, case sensitivity and cross-platform behavior #16731

@rjerue

Description

@rjerue

So, when using fs commands across platforms, I've noticed some interesting behavior with case sensitivity. On OSes where case sensitivity is not a concern like Windows and OSX, node's file i/o calls work the same with not caring about case sensitivity. Whereas on Linux it does.

For example,

util.promisify(fs.readdir)('./foo/bar.txt').then( files => console.log(file))

and

util.promisify(fs.readdir)('./Foo/bar.txt').then( files => console.log(file))

Will do the same thing on OSX and Windows, however on Ubuntu (which I am using in a production environment), will only see what is actually on the file system. As node aims to be cross-platform it may be beneficial to have the stricter behavior be constant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.fsIssues and PRs related to the fs subsystem / file system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions