-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Omission in the fs doc #7099
Comments
Is |
I think that should be understood as, when set, they start counting from zero, not one.
I agree. @nodejs/documentation: when Mixing sequential reads and writes with concurrent asynchronous file operations is usually unwise because there is no telling in which order they run. Not an issue in the OP's example but replacing |
@bnoordhuis / @nodejs/documentation: before I commit/PR, can I get feedback on wording updates? How's this? Updated wording below:
|
@WesTyler Sounds good to me. |
* 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: #7099 PR-URL: #10078 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
* 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: nodejs#7099 PR-URL: nodejs#10078 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
* 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: #7099 PR-URL: #10078 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
* 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: #7099 PR-URL: #10078 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
* 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: #7099 PR-URL: #10078 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
* 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: #7099 PR-URL: #10078 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
Sometimes I use the same file descriptor for writing and then reading by
readline
(possible case: write some data line by line, then reread it into an array to sort and rewrite).It seems
fs
doc lacks for some point concerning these cases.fs.createReadStream(path[, options]):
Maybe it should be mentioned that
start
is set by default to the file end (or to the write position) for fd that has been previously written into.Test:
The output is only
The output contains all the file:
The text was updated successfully, but these errors were encountered: