I'm not sure if this is a feature or a bug, but, as the title suggests, the path argument for fs.mkdir and its synchronous counterpart is case-insensitive. Assuming that there exists a folder named foo in the current working directory, this code throws an error with code EEXISTS.
// This throws an error because a directory named `foo` already exists.
require('fs').mkdir('Foo', console.error);
This baffled me at first because directories are supposed to be case-sensitive, right? So yeah, I'm still not sure if this is a bug, but I'm putting it here just to be sure.
On Windows, file systems are case-insensitive, you cannot create such 2 dirs in a shell or Explorer as well:
>md foo
>md Foo
A subdirectory or file Foo already exists.
Aww, man... That sucks. 😞 Is there any workaround for it at least?
If you really want to try, this link might help a bit: https://superuser.com/a/842670
I think this question has been answered as well as possible – if you have follow-up questions, can you open an issue at https://github.com/nodejs/help?
Okay, I see. Thanks for the help, guys! I appreciate it.
Most helpful comment
On Windows, file systems are case-insensitive, you cannot create such 2 dirs in a shell or Explorer as well: