FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fs: add bytesRead to ReadStream by LinusU · Pull Request #7942 · nodejs/node · GitHub

/ node Public

fs: add bytesRead to ReadStream - #7942

Closed
LinusU wants to merge 1 commit into
nodejs:masterfrom
LinusU:fs-read-stream-bytes-read
Closed

fs: add bytesRead to ReadStream#7942
LinusU wants to merge 1 commit into
nodejs:masterfrom
LinusU:fs-read-stream-bytes-read

Conversation

LinusU commented Aug 1, 2016

Copy link
Copy Markdown
Contributor
Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

fs

Description of change

Add a property named bytesRead that exposes how many bytes that have currently been read from the file. This brings consistency with WriteStream that has bytesWritten and net.Socket which have both bytesRead and bytesWritten.

Fixes #7938

nodejs-github-bot added the fs Issues and PRs related to the fs subsystem / file system. label Aug 1, 2016
LinusU force-pushed the fs-read-stream-bytes-read branch from 8bcf224 to 6b436d9 Compare August 1, 2016 19:45
Comment thread test/parallel/test-fs-read-stream.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You could also add a line that compares file.bytesRead with the actual file size, like this:

assert.strictEqual(file.bytesRead, fs.statSync(fn).size);

jasnell commented Aug 1, 2016

Copy link
Copy Markdown
Member

Generally LGTM with Green CI and @addaleax's comment addressed

jasnell added the semver-minor PRs that contain new features and should be released in the next minor version. label Aug 1, 2016

Copy link
Copy Markdown
Contributor

Thank you for this, a very welcome addition. 👍

LinusU force-pushed the fs-read-stream-bytes-read branch from 6b436d9 to 5fcd263 Compare August 2, 2016 06:02

LinusU commented Aug 2, 2016
edited
Loading

Copy link
Copy Markdown
Contributor Author

Addressed comment and rebased on latest master 👌

edit: How do I trigger CI? Or is that something that someone from the core team does?

Copy link
Copy Markdown
Contributor

Here you go: https://ci.nodejs.org/job/node-test-pull-request/3496/

LinusU commented Aug 2, 2016
edited
Loading

Copy link
Copy Markdown
Contributor Author

Finished: SUCCESS

✅ Green CI

jasnell commented Aug 4, 2016

Copy link
Copy Markdown
Member

@addaleax @bnoordhuis @trevnorris ... would love to get your review on this also!

Comment thread doc/api/fs.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I’d say with 99 % confidence that the version here is accurate, but ideally you can use added: REPLACEME here so that the correct version will be inserted when the release is made.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

oh, good catch... yeah, using REPLACEME is likely better

addaleax commented Aug 4, 2016

Copy link
Copy Markdown
Member

LGTM with a comment, thanks for the work behind this!

Copy link
Copy Markdown
Member

LGTM

Add a property named bytesRead that exposes how many bytes that have
currently been read from the file. This brings consistency with
WriteStream that has bytesWritten and net.Socket which have both
bytesRead and bytesWritten.

Fixes nodejs#7938
LinusU force-pushed the fs-read-stream-bytes-read branch from 5fcd263 to 460a501 Compare August 5, 2016 08:58

LinusU commented Aug 5, 2016

Copy link
Copy Markdown
Contributor Author
  • Switched from v6.4.0 to REAPLCEME
  • Rebased on latest master

jasnell commented Aug 5, 2016

Copy link
Copy Markdown
Member

Thank you for bearing with us! :-) One more CI run following the updated commits: https://ci.nodejs.org/job/node-test-pull-request/3544/

jasnell commented Aug 5, 2016

Copy link
Copy Markdown
Member

There was a build bot failure on freebsd... running again just to make sure it's a one off: https://ci.nodejs.org/job/node-test-pull-request/3546/

jasnell commented Aug 8, 2016

Copy link
Copy Markdown
Member

hmm... failed on freebsd again... one more try: https://ci.nodejs.org/job/node-test-pull-request/3572/

jasnell commented Aug 8, 2016

Copy link
Copy Markdown
Member

Failed on Windows this time, unrelated build bot failure tho, at least that's different from last time. getting this landed!

jasnell pushed a commit that referenced this pull request Aug 8, 2016
Add a property named bytesRead that exposes how many bytes that have
currently been read from the file. This brings consistency with
WriteStream that has bytesWritten and net.Socket which have both
bytesRead and bytesWritten.

Fixes: https://github.com/nodejs/node/issues/#7938
PR-URL: #7942
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

jasnell commented Aug 8, 2016

Copy link
Copy Markdown
Member

Landed in 4a87abb. Thank you!

jasnell closed this Aug 8, 2016
cjihrig mentioned this pull request Aug 8, 2016

LinusU commented Aug 9, 2016

Copy link
Copy Markdown
Contributor Author

Awesome 🎉 thank you!

LinusU deleted the fs-read-stream-bytes-read branch August 9, 2016 08:22
cjihrig pushed a commit that referenced this pull request Aug 10, 2016
Add a property named bytesRead that exposes how many bytes that have
currently been read from the file. This brings consistency with
WriteStream that has bytesWritten and net.Socket which have both
bytesRead and bytesWritten.

Fixes: https://github.com/nodejs/node/issues/#7938
PR-URL: #7942
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
cjihrig mentioned this pull request Aug 11, 2016
cjihrig added a commit that referenced this pull request Aug 11, 2016
Notable changes:

* build: zlib symbols and additional OpenSSL symbols are now exposed on Windows platforms. (Alex Hultman) #7983 and #7576
* child_process, cluster: Forked child processes and cluster workers now support stdio configuration. (Colin Ihrig) #7811 and #7838
* fs: fs.ReadStream now exposes the number of bytes it has read so far. (Linus Unnebäck) #7942
* repl: The REPL now supports editor mode. (Prince J Wesley) #7275
* util: inspect() can now be configured globally using util.inspect.defaultOptions. (Roman Reiss) #8013

Refs: #8020
PR-URL: #8070
cjihrig added a commit that referenced this pull request Aug 11, 2016
Notable changes:

* build: zlib symbols and additional OpenSSL symbols are now exposed on Windows platforms. (Alex Hultman) #7983 and #7576
* child_process, cluster: Forked child processes and cluster workers now support stdio configuration. (Colin Ihrig) #7811 and #7838
* child_process: argv[0] can now be set to arbitrary values in spawned processes. (Pat Pannuto) #7696
* fs: fs.ReadStream now exposes the number of bytes it has read so far. (Linus Unnebäck) #7942
* repl: The REPL now supports editor mode. (Prince J Wesley) #7275
* util: inspect() can now be configured globally using util.inspect.defaultOptions. (Roman Reiss) #8013

Refs: #8020
PR-URL: #8070
cjihrig added a commit that referenced this pull request Aug 15, 2016
Notable changes:

* build: zlib symbols and additional OpenSSL symbols are now exposed on Windows platforms. (Alex Hultman) #7983 and #7576
* child_process, cluster: Forked child processes and cluster workers now support stdio configuration. (Colin Ihrig) #7811 and #7838
* child_process: argv[0] can now be set to arbitrary values in spawned processes. (Pat Pannuto) #7696
* fs: fs.ReadStream now exposes the number of bytes it has read so far. (Linus Unnebäck) #7942
* repl: The REPL now supports editor mode. (Prince J Wesley) #7275
* util: inspect() can now be configured globally using util.inspect.defaultOptions. (Roman Reiss) #8013

Refs: #8020
PR-URL: #8070
cjihrig added a commit to cjihrig/node that referenced this pull request Aug 16, 2016
Notable changes:

* build: zlib symbols and additional OpenSSL symbols are now exposed on Windows platforms. (Alex Hultman) nodejs#7983 and nodejs#7576
* child_process, cluster: Forked child processes and cluster workers now support stdio configuration. (Colin Ihrig) nodejs#7811 and nodejs#7838
* child_process: argv[0] can now be set to arbitrary values in spawned processes. (Pat Pannuto) nodejs#7696
* fs: fs.ReadStream now exposes the number of bytes it has read so far. (Linus Unnebäck) nodejs#7942
* repl: The REPL now supports editor mode. (Prince J Wesley) nodejs#7275
* util: inspect() can now be configured globally using util.inspect.defaultOptions. (Roman Reiss) nodejs#8013

Refs: nodejs#8020
PR-URL: nodejs#8070
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fs Issues and PRs related to the fs subsystem / file system. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL