diff options
author | dcharbonnier <d.charbonnier@oxys.net> | 2017-08-03 19:37:09 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-08-07 15:04:55 -0700 |
commit | 680285c3b427a698fa254e51d5bf2fba59af2f2a (patch) | |
tree | 403799d71fa4f16dda7b37c8b05db5746ba46654 /doc | |
parent | 3f98b0f33ccce6b6c8ab97c810eceb3bf3b5bef5 (diff) | |
download | node-new-680285c3b427a698fa254e51d5bf2fba59af2f2a.tar.gz |
doc: clarify the position argument for fs.read
What happen to the file position after a read using a position null or
integer was not clear and you can assume that the cursor of the file
descriptor is updated even if position is an integer.
PR-URL: https://github.com/nodejs/node/pull/14631
Fixes: https://github.com/https://github.com/nodejs/node/issues/8397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/fs.md | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md index 6c8cbf42dc..c208a24959 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1640,7 +1640,9 @@ Read data from the file specified by `fd`. `length` is an integer specifying the number of bytes to read. `position` is an integer specifying where to begin reading from in the file. -If `position` is `null`, data will be read from the current file position. +If `position` is `null`, data will be read from the current file position, +and the file position will be updated for subsequent reads. +If `position` is an integer, the file position will remain unchanged. The callback is given the three arguments, `(err, bytesRead, buffer)`. |