GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: stdout/stderr can block when directed to file · nodejs/node@a0db5fb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • process.markdown
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/process.markdown‎

Copy file name to clipboardExpand all lines: doc/api/process.markdown
+6-9Lines changed: 6 additions & 9 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ For example, a `console.log` equivalent could look like this:
282282

283283
`process.stderr` and `process.stdout` are unlike other streams in Node.js in
284284
that they cannot be closed (`end()` will throw), they never emit the `finish`
285-
event and that writes are always blocking.
285+
event and that writes can block when output is redirected to a file (although
286+
disks are fast and operating systems normally employ write-back caching so it
287+
should be a very rare occurrence indeed.)
286288

287289
To check if Node.js is being run in a TTY context, read the `isTTY` property
288290
on `process.stderr`, `process.stdout`, or `process.stdin`:
@@ -305,14 +307,9 @@ A writable stream to stderr (on fd `2`).
305307

306308
`process.stderr` and `process.stdout` are unlike other streams in Node.js in
307309
that they cannot be closed (`end()` will throw), they never emit the `finish`
308-
event and that writes are usually blocking.
309-
310-
- They are blocking in the case that they refer to regular files or TTY file
311-
descriptors.
312-
- In the case they refer to pipes:
313-
- They are blocking in Linux/Unix.
314-
- They are non-blocking like other streams in Windows.
315-
310+
event and that writes can block when output is redirected to a file (although
311+
disks are fast and operating systems normally employ write-back caching so it
312+
should be a very rare occurrence indeed.)
316313

317314
## process.stdin
318315

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.