fix createWriteStream failing to create new files, fixes #428
This issue provides most of the context: https://github.com/streamich/unionfs/issues/428
#428 suggests just to replace fs.statSync(path) with fs.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"
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: