mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
doc: clarify fs.createReadStream options
* start/end start *counting* at 0 * If fd is specified and start is omitted or undefined, fs.createReadStream() reads sequentially from the current file position. Fixes: https://github.com/nodejs/node/issues/7099 PR-URL: https://github.com/nodejs/node/pull/10078 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Roman Reiss <me@silverwind.io>
This commit is contained in:
1 parent
44d9bc8b90
commit
78e188d929
1 file changed
+3
-1
+3
-1
@@ -602,7 +602,9 @@ default value of 64 kb for the same parameter.
|
||||
|
||||
`options` can include `start` and `end` values to read a range of bytes from
|
||||
the file instead of the entire file. Both `start` and `end` are inclusive and
|
||||
start at 0. The `encoding` can be any one of those accepted by [`Buffer`][].
|
||||
start counting at 0. If `fd` is specified and `start` is omitted or `undefined`,
|
||||
`fs.createReadStream()` reads sequentially from the current file position.
|
||||
The `encoding` can be any one of those accepted by [`Buffer`][].
|
||||
|
||||
If `fd` is specified, `ReadStream` will ignore the `path` argument and will use
|
||||
the specified file descriptor. This means that no `'open'` event will be
|
||||
|
||||
Reference in new issue
Block a user