filerjs / filer

Node-like file system for browsers
BSD 2-Clause "Simplified" License
613 stars 153 forks source link

BUG: fs.mkdir does not recursively create parent directories when called with { recursive: true } #776

Closed bcheidemann closed 3 years ago

bcheidemann commented 3 years ago

Executing the following code:

fs.mkdir('/test_dir/a/b', { recursive: true }, callback);

(when /test_dir does not exist)

Throws the error:

ENOENT: no such file or directory, '/test_dir'
    at new FilerError (tests.e31bb0bc.js:13841:18)
    at get_node_from_parent_directory_data (tests.e31bb0bc.js:16783:18)
    at IDBRequest.onsuccess (tests.e31bb0bc.js:13443:7)

This is not consistent with the node.js documentation on fs.mkdir.

humphd commented 3 years ago

I started this in https://github.com/filerjs/filer/pull/479. I'm trying to remember why I didn't finish, and I think it was the missing mode stuff, which we have now.

bcheidemann commented 3 years ago

Duplicate of #414