Skip to content

Commit d604173

Browse files
dcharbonnieraddaleax
authored andcommitted
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: #14631 Fixes: #8397 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent 2716b62 commit d604173

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/api/fs.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,9 @@ Read data from the file specified by `fd`.
16401640
`length` is an integer specifying the number of bytes to read.
16411641

16421642
`position` is an integer specifying where to begin reading from in the file.
1643-
If `position` is `null`, data will be read from the current file position.
1643+
If `position` is `null`, data will be read from the current file position,
1644+
and the file position will be updated for subsequent reads.
1645+
If `position` is an integer, the file position will remain unchanged.
16441646

16451647
The callback is given the three arguments, `(err, bytesRead, buffer)`.
16461648

0 commit comments

Comments
 (0)