-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fs.open fails on directory #58
Comments
It should probably emulate Node.js behaviour:
// macOS and Linux
fs.open('<directory>', 'a+', (err, fd) => {
// => [Error: EISDIR: illegal operation on a directory, open <directory>]
});
// Windows and FreeBSD
fs.open('<directory>', 'a+', (err, fd) => {
// => null, <fd>
}); |
For |
Also, the open(2) docs say: |
Please, take a look at #59 |
Looks good, thx, I've merged it. |
It has been released here: |
Thanks! |
memfs version: 2.6.0
OS version: macOS High Sierra 10.13.2 (17C88)
fs.open
with read flag fails on directory. Though Nodejs'fs
module allows to "open" folder.A short code snippet to reproduce the issue:
produces the output:
Why to open directory? Sometimes, to ensure that a new file is created and exists in directory listing -
fsync
on parent directory must be called. Some details could be found https://www.quora.com/When-should-you-fsync-the-containing-directory-in-addition-to-the-file-itself .The text was updated successfully, but these errors were encountered: