Skip to content

Conversation

@seppevs
Copy link
Contributor

doc: stdout, stderr and stdin are all Duplex streams but documentation states otherwise

This is a fix for #9201

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc

@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to the documentations. process Issues and PRs related to the process subsystem. labels Feb 6, 2017
@jasnell
Copy link
Member

I'm not convinced that we should document these as Duplex and it's not entirely clear if that's always going to be the case. For instance, it does not make sense to treat stdin as a Writable.

@addaleax
Copy link
Member

For instance, it does not make sense to treat stdin as a Writable.

Just for clarification, that stdin is a “readable” stream and stdout/stderr are “writable” streams is only a convention and not enforced by the OS in any way (at least on UNIX and I think it applies to Windows, too).

I don’t think it’s Node’s place to enforce these convention when the OS doesn’t.

@jasnell
Copy link
Member

True, but it's also not that practically useful unless there's an obscure use case I'm missing.

@Fishrock123
Copy link
Contributor

Fishrock123 commented Feb 6, 2017

True, but it's also not that practically useful unless there's an obscure use case I'm missing.

Maybe we could start printing warnings to fd 0. 😛

The docs are still technically correct due to the weirdness that is the stdio impl.

I think changing it to note that it is net.Socket (inherits from stream.Duplex) unless it is from/to a file, in which case it is a fs.sync{Write|Read}Stream, could be more useful.

@jasnell
Copy link
Member

That would be certainly more useful

@sam-github
Copy link
Contributor

Just because it may not be used very often doesn't mean its not useful. Why should we have an opinion on this, particularly if its platform independent, and pre-existing? There are interesting use-cases, like gpg, where processes read and write from arbitrary fds, I like that such programs can be written in node, that its not just for webapps.

@sam-github
Copy link
Contributor

Agree with #11194 (comment), we should doc its actual class.

@seppevsseppevsforce-pushed the docs_stdout_stderr_and_stdin_are_duplex_streams branch from 30d6058 to 5a00980CompareFebruary 13, 2017 09:51
@seppevs
Copy link
ContributorAuthor

I've amended changes to the commit so the actual class is now documented.

@Fishrock123Fishrock123 self-assigned this Feb 14, 2017
Copy link
Contributor

@sam-githubsam-github left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some suggestions, I find the "from/to" confusing, but basically LGTM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest: "unless fd 2 refers to a file, "

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sam-github Thank you for reviewing. I made the requested changes and rebased with master. I had some merge conflicts on the same sections in the docs.
Can you review again? Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"(which inherits"

@seppevsseppevsforce-pushed the docs_stdout_stderr_and_stdin_are_duplex_streams branch 2 times, most recently from b78f255 to a7b5e61CompareFebruary 16, 2017 20:00
@sam-github
Copy link
Contributor

code looks good, @Fishrock123 assigned this to himself, so he'll need a chance to review

you should shorten your commit message, guidelines are here: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#step-3-commit

Copy link
Member

@jasnelljasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there, small nit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be worthwhile to have this (and the other reference below) be a link to the Duplex doc

@seppevsseppevsforce-pushed the docs_stdout_stderr_and_stdin_are_duplex_streams branch from a7b5e61 to d5793b7CompareFebruary 17, 2017 08:15
@seppevs
Copy link
ContributorAuthor

@jasnell: I made the changes, can you review again?

Copy link
Contributor

@Fishrock123Fishrock123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one small comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you link net.Socket to it's definition in net.md? Thanks!

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seppevsseppevsforce-pushed the docs_stdout_stderr_and_stdin_are_duplex_streams branch from d5793b7 to a2f9c82CompareFebruary 22, 2017 09:39
@fhinkel
Copy link
Member

@seppevs sorry this took so long, by now process.md has changed. Can you rebase and make [Duplex] look like the other entries? Thanks!

@seppevsseppevsforce-pushed the docs_stdout_stderr_and_stdin_are_duplex_streams branch from a2f9c82 to b3a6a25CompareMarch 27, 2017 07:39
@seppevs
Copy link
ContributorAuthor

@fhinkel done!

fhinkel pushed a commit that referenced this pull request Mar 27, 2017
stdout, stderr and stdin are all Duplex streams but documentation states otherwise Fixes#9201 PR-URL: #11194 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
@aqrln
Copy link
Contributor

@cjihrig just for the record, this patch had been landed in 1005b1d before your approval.
@fhinkel was this an accidental push or you just forgot to close the PR?

@Fishrock123
Copy link
Contributor

Looks like she forgot to close it. Please re-open if this was in error.

MylesBorins pushed a commit that referenced this pull request Mar 28, 2017
stdout, stderr and stdin are all Duplex streams but documentation states otherwise Fixes#9201 PR-URL: #11194 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request Mar 28, 2017
@italoacasasitaloacasas mentioned this pull request Apr 10, 2017
2 tasks
MylesBorins pushed a commit that referenced this pull request Apr 18, 2017
stdout, stderr and stdin are all Duplex streams but documentation states otherwise Fixes#9201 PR-URL: #11194 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
@MylesBorins
Copy link
Contributor

backported to v6.x-staging. If it should be backed out lmk

MylesBorins pushed a commit that referenced this pull request Apr 19, 2017
stdout, stderr and stdin are all Duplex streams but documentation states otherwise Fixes#9201 PR-URL: #11194 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request Apr 19, 2017
andrew749 pushed a commit to michielbaird/node that referenced this pull request Jul 19, 2017
stdout, stderr and stdin are all Duplex streams but documentation states otherwise Fixesnodejs/node#9201 PR-URL: nodejs/node#11194 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docIssues and PRs related to the documentations.processIssues and PRs related to the process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@seppevs@jasnell@addaleax@Fishrock123@sam-github@fhinkel@aqrln@MylesBorins@cjihrig@nodejs-github-bot