Skip to content

Commit

Permalink
doc: clarify the position argument for fs.read
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dcharbonnier authored and Trott committed Aug 7, 2017
1 parent 3f98b0f commit 680285c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)`.

Expand Down

0 comments on commit 680285c

Please sign in to comment.