memfs
memfs copied to clipboard
`chmodSync` throws EISDIR for directories
Running chmodSync on a directory fails with EISDIR:
var { fs } = require("memfs")
fs.mkdirSync('/foo')
fs.chmodSync('/foo', 0o666)
The error is: Error: EISDIR: illegal operation on a directory, open '/foo'.
(Try it: https://runkit.com/dabbott/memfs-chmodsync/1.0.0)
The same calls seem to work with node's built-in fs, as long as it's a directory where you have permission to write, so I'm guessing this is an issue with chmodSync?
If this is a bug I can try to submit a PR. I haven't looked through the code yet, but seems like it'd be a quick change.
Running chmod (not sync) works. Also, running openSync and then fchmodSync works, as a workaround:
var { fs } = require("memfs")
fs.mkdirSync('/foo')
fs.fchmodSync(fs.openSync('/foo', 'r'), 0o666)
Looks like the same issue as #391.
:tada: This issue has been resolved in version 3.4.10 :tada:
The release is available on:
Your semantic-release bot :package::rocket: