-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Documentation: fd
option of fs.createReadStream
#7707
Comments
Here's some items of interest when passing an
DISCLAIMER — please don't take the above "documentation" as an official API commitment, I am just some yokel nosing around in someone's else's code to see how it might currently behave. |
You probably don't want lots of +1 and "me too" comments, but the lack of documentation here did waste a good day or so of my time. I'm writing a TUN/TAP device module in mostly pure JavaScript (using ioctl and ref-struct). Ideally once the TUN/TAP device is open I'd like to pass it back to the module consumer as a Duplex stream. I've written this up as a StackOverflow question. Someone commented that this functionality exists, but being that it's not documented I don't know whether or not it's part of the public API and whether or not it can be used without fear of it disappearing on me without warning. As an aside, I'd really love it if it were possible to do |
Of course, if someone was willing to provide me with the highlights, I'd be very happy to submit a pull request. Feel free to get in touch with me via skype at 'benjamin.burns' if that's easier than commenting here. |
Could you please submit a PR fixing it? |
Sounds like it's not left undocumented on purpose, then, and the maintainers are tentatively okay with committing to the current /de facto/ behavior? |
@benjamincburns assuming the current fd option to fs.createReadStream/fs.createWriteStream becomes /de jure/ interface, you might want to just wrap those up in a little npm module that creates a duplex stream as you describe! |
@benjamincburns go ahead and open it! :) |
Addressed by #8001. |
The documentation for
fs.createReadStream
shows that the default value of anfd
option isnull
, but it does not explain what it is for or how it interacts with the path parameter (and mode/flags options, etc.) and the autoClose option.I did find this brief discussion:
https://groups.google.com/forum/#!topic/nodejs/IhLJr57EDWc
The text was updated successfully, but these errors were encountered: