From 242438997222c47f19da303e4d2390b9066feaa9 Mon Sep 17 00:00:00 2001 From: Wes Tyler Date: Thu, 1 Dec 2016 15:03:55 -0600 Subject: [PATCH] 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 Reviewed-By: Gibson Fahnestock Reviewed-By: Anna Henningsen Reviewed-By: Roman Reiss --- doc/api/fs.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index afae9ca66488e8..d20024419cb247 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -503,7 +503,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 emitted.