-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
feat: implement createReadStream
and createWriteStream
on FileHandle
#1076
Conversation
Well, that's embarrassing: the first version of this that I submitted didn't work, due to another issue: the In my second commit, I've aligned that behavior with the Node API (which makes my first commit work), and in my third commit, I've added a test for this. Let me know if you want me to rebase, or handle any of this differently. |
createReadStream
and createWriteStream
on FileHandle
would you be ok doing a dedicated PR for that? it sounds like it's a clean bugfix that can get its own version and changelog entry |
Done: #1077 I'll wait for that to be merged then rebase this. |
21f729d
to
c550f22
Compare
Rebased! |
@@ -33,6 +33,14 @@ export class FileHandle implements IFileHandle { | |||
return promisify(this.fs, 'fdatasync')(this.fd); | |||
} | |||
|
|||
createReadStream(options: opts.IFileHandleReadStreamOptions): IReadStream { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be possible to get some basic tests for these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (adapted from the equivalent tests for the volume interface)
@G-Rath, I think this is ready to go! The X is only because it doesn't like my commit message for the second commit; squashing will fix that. Would be nice to get this in so I can use an official release in my project :) |
🎉 This PR is included in version 4.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes #1063
Thanks for making this library! My test needed these methods to exist so I took a stab at adding support.