Skip to content

Commit 5a7a49f

Browse files
dcharbonnierMylesBorins
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 caeee38 commit 5a7a49f

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
@@ -1309,7 +1309,9 @@ Read data from the file specified by `fd`.
13091309
`length` is an integer specifying the number of bytes to read.
13101310

13111311
`position` is an integer specifying where to begin reading from in the file.
1312-
If `position` is `null`, data will be read from the current file position.
1312+
If `position` is `null`, data will be read from the current file position,
1313+
and the file position will be updated for subsequent reads.
1314+
If `position` is an integer, the file position will remain unchanged.
13131315

13141316
The callback is given the three arguments, `(err, bytesRead, buffer)`.
13151317

0 commit comments

Comments
 (0)