Closed dy-dx closed 8 months ago
I've just noticed that unionfs
iterates backwards through the this.fss
array for most operations, except when using createWriteStream
/createReadStream
.
This seems like a mistake, and I'll address it in ~this PR as well~.
Addressed in https://github.com/streamich/unionfs/pull/785
:tada: This PR is included in version 4.5.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
This issue provides most of the context: https://github.com/streamich/unionfs/issues/428
428 suggests just to replace
fs.statSync(path)
withfs.statSync(dirname(path))
, but that could cause surprising behavior in the case where multiple filesystems include the parent directory.I've added a regression test for this case:
"createWriteStream writes to an existing file even if parent dir exists on an earlier fss"
Fixes #428