creates undefined directories
See original GitHub issueWas comparing memfs
and memory-fs
and was failing a test. Discovered that memfs
will create undefined directories when you fs.mkdirSync("/");
and that directory already exists.
// test.js
const {Volume} = require("memfs");
var fs = new Volume();
// snippet from https://github.com/webpack/memory-fs/blob/master/test/MemoryFileSystem.js#L18
fs.mkdirSync("/test");
console.log(fs.readdirSync("/"));
fs.mkdirSync("/test//sub/");
console.log(fs.readdirSync("/"));
fs.mkdirpSync("/test/sub2");
console.log(fs.readdirSync("/"));
fs.mkdirSync("/root\\dir");
console.log(fs.readdirSync("/"));
fs.mkdirpSync("/");
console.log(fs.readdirSync("/"));
fs.mkdirSync("/"); // <-- this should probably throw; creates an "undefined" folder instead
console.log(fs.readdirSync("/")); // --> [ 'root\\dir', 'test', 'undefined' ]
$ node test.js
[ 'test' ]
[ 'test' ]
[ 'test' ]
[ 'root\\dir', 'test' ]
[ 'root\\dir', 'test' ]
[ 'root\\dir', 'test', 'undefined' ]
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Starting IDE creates "undefined" folder in current directory #394
Steps to reproduce the behavior: Start the IDE; go to home folder; be happy with "undefined" folder ... Just giving it a more...
Read more >Create folder returns undefined when trying to find file id
This code returns undefined for the id of the folder. I don't want to use the list method to search the drive after...
Read more >Installed a program into an undefined folder
The new program is not listed under All Programs. I can only start it by clicking on the program in the Computer directory....
Read more >Undefined folder in File Browser - JCE Editor
Hi, I'm using JCE Editor Core 2.8.6 with Joomla 3.9.15 and Chrome and I'm experiencing a strange behaviour using File Browser.
Read more >Failed to create folder. (Undefined index: expiry) - FileRun
I get this when trying to create the original superuser directory. I'm sure it's a PHP write issue, but how do I go...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
🎉 This issue has been resolved in version 2.15.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
Im
memfs
stream implementation is copied from Node almost verbatim.