Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Why isn't fd option of fs.createWriteStream documented? #7708

Closed
natevw opened this issue May 30, 2014 · 2 comments
Closed

Why isn't fd option of fs.createWriteStream documented? #7708

natevw opened this issue May 30, 2014 · 2 comments
Labels

Comments

@natevw
Copy link

natevw commented May 30, 2014

Although just barely (see #7707), the fd option to fs.createReadStream is publicly documented. However for fs.createWriteStream no mention is made, although I see in the code it is supported.

Is this feature supposed to be publicly used only with readStream, or encouraged with both, or publicly supported with neither?

@natevw
Copy link
Author

natevw commented May 30, 2014

FWIW, it looks like the following interesting facts are true about passing an fd to fs.createWriteStream:

  • the 'open' event is not fired if you pass in a file descriptor
  • once 'finish' fires, fd will be closed, i.e. there is no support for an 'autoClose:false' option like fs.createReadStream
  • TBD

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.

chrisdickinson pushed a commit that referenced this issue Dec 16, 2014
Clarify the fd option: it is preferred to the path parameter, omits
the "open" event if given, and is available on WriteStreams as well.

PR-URL: #7707
Fixes: #7707
Fixes: #7708
Fixes: #4367
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
@chrisdickinson
Copy link

Addressed by #8001.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants