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

Commit

Permalink
doc: Correct stream.write fd mention
Browse files Browse the repository at this point in the history
No streams actually work this way.
  • Loading branch information
isaacs committed Oct 1, 2012
1 parent 3b7312d commit b90c150
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions doc/api/stream.markdown
Expand Up @@ -146,20 +146,14 @@ Emitted when the stream is passed to a readable stream's pipe method.
A boolean that is `true` by default, but turns `false` after an
`'error'` occurred or `end()` / `destroy()` was called.

### stream.write(string, [encoding], [fd])
### stream.write(string, [encoding])

Writes `string` with the given `encoding` to the stream. Returns `true`
if the string has been flushed to the kernel buffer. Returns `false` to
indicate that the kernel buffer is full, and the data will be sent out
in the future. The `'drain'` event will indicate when the kernel buffer
is empty again. The `encoding` defaults to `'utf8'`.

If the optional `fd` parameter is specified, it is interpreted as an
integral file descriptor to be sent over the stream. This is only
supported for UNIX streams, and is silently ignored otherwise. When
writing a file descriptor in this manner, closing the descriptor before
the stream drains risks sending an invalid (closed) FD.

### stream.write(buffer)

Same as the above except with a raw buffer.
Expand Down

0 comments on commit b90c150

Please sign in to comment.