Closed bytesnz closed 6 years ago
As of now unionfs
does not properly support streams.
It can be implemented, but requires substantial work. Basically ReadStream
and WriteStream
classes as well as createReadStream
and writeReadStream
would need to be re-implemented inside unionfs
and they would have to use unionfs
for their operations. Basically the above mentioned methods need to be ported, similar how it is done here:
Would it be possible to just pass through to the createReadStream functions from the union-ed filesystems, eg go through the filesystems until one doesn't throw an error?
Testing a module that uses readline with a unionfs
createReadStream
does not work.Error encountered:
Test file:
Actual file under test: https://gitlab.com/bytesnz/keeps-on-ticking/blob/6-add-function-testing/lib/file.js (https://gitlab.com/bytesnz/keeps-on-ticking/blob/6-add-function-testing/src/lib/file.ts)
Using files: https://gitlab.com/bytesnz/keeps-on-ticking/blob/6-add-function-testing/lib/file.test.js (https://gitlab.com/bytesnz/keeps-on-ticking/blob/6-add-function-testing/src/lib/file.test.ts) https://gitlab.com/bytesnz/keeps-on-ticking/blob/6-add-function-testing/test/lib/unionfs.js (https://gitlab.com/bytesnz/keeps-on-ticking/blob/6-add-function-testing/src/test/lib/unionfs.ts)