Uh oh!
There was an error while loading. Please reload this page.
fs: add autoClose option to fs.createWriteStream - #3679
Conversation
saquibkhan
commented
Nov 5, 2015
@jasnell@misterdjules As discussed I created a new pull request for autoClose feature. node-v0.x-archive/pull/25275 This PR can be landed on v5/v4/v0.12/v0.10 it would be really nice if i see this PR land :-) |
Fishrock123
commented
Nov 5, 2015
cc @nodejs/streams |
bnoordhuis
commented
Nov 5, 2015
Basic premise looks alright to me. The checks in the test can be made a little tighter. |
4a6f713 to
991b6f5Comparesaquibkhan
commented
Nov 5, 2015
@bnoordhuis Done! I updated the review comments given by you. |
991b6f5 to
4400ee7Comparejasnell
commented
Nov 5, 2015
Overall this is fine, but as a semver-minor it woud not be able to land in v0.10, v0.12 or v4.x. |
There was a problem hiding this comment.
Would like to see this reworded a bit to make it absolutely obvious that the default behavior is autoClose = true. Perhaps move the third sentence to the front?
jasnell
commented
Nov 5, 2015
LGTM with one nit on the docs |
ronkorving
commented
Nov 6, 2015
In your PR message, you write |
4400ee7 to
273c758Comparesaquibkhan
commented
Nov 6, 2015
@jasnell@ronkorving Done! Updated the doc and commit message. Thanks! |
ronkorving
commented
Nov 6, 2015
The PR message still says "true" instead of "false", sorry :) Commit message is 👍 |
saquibkhan
commented
Nov 6, 2015
@ronkorving Done! |
jasnell
commented
Nov 13, 2015
@saquibkhan ... when you get a chance, please take a look at @bnoordhuis' comments, then please rebase and update :-) |
273c758 to
c82c2a9CompareThere was a problem hiding this comment.
I am using ! to test fd is not null
There was a problem hiding this comment.
if you're specifically testing for not null, perhaps assert(stream.fd !== null) would be better
saquibkhan
commented
Nov 14, 2015
@bnoordhuis@jasnell I have updated the code as per review comments. |
ronkorving
commented
Nov 16, 2015
@saquibkhan "This branch has conflicts that must be resolved" |
There was a problem hiding this comment.
Can you add a !! on the last options.autoClose to guarantee we have a Boolean.
3b9ffce to
3f24d5cComparesaquibkhan
commented
Dec 10, 2015
@cjihrig@ronkorving@jasnell@bnoordhuis Updated the code as per the review comments.. LGTM |
cjihrig
commented
Dec 10, 2015
LGTM pending CI |
Add support to fs.createWriteStream and fs.createWriteStream for an autoClose option that behaves similarly to the autoClose option supported by fs.createReadStream and fs.ReadStream. When an instance of fs.createWriteStream created with autoClose === false finishes, it is not destroyed. Its underlying fd is not closed and it is the responsibility of the user to close it.
3f24d5c to
98849bcComparesaquibkhan
commented
Jan 11, 2016
@ronkorving@jasnell@bnoordhuis@cjihrig Can we merge? |
jasnell
commented
Jan 11, 2016
jasnell
commented
Jan 11, 2016
unrelated failure in CI |
Add support to fs.createWriteStream and fs.createWriteStream for an autoClose option that behaves similarly to the autoClose option supported by fs.createReadStream and fs.ReadStream. When an instance of fs.createWriteStream created with autoClose === false finishes, it is not destroyed. Its underlying fd is not closed and it is the responsibility of the user to close it. PR-URL: #3679 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
jasnell
commented
Jan 11, 2016
Landed in 6039a7c |
Add support to fs.createWriteStream and fs.createWriteStream for an autoClose option that behaves similarly to the autoClose option supported by fs.createReadStream and fs.ReadStream. When an instance of fs.createWriteStream created with autoClose === false finishes, it is not destroyed. Its underlying fd is not closed and it is the responsibility of the user to close it. PR-URL: #3679 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Notable changes: * events: make sure console functions exist (Dave) #4479 * fs: add autoClose option to fs.createWriteStream (Saquib) #3679 * http: improves expect header handling (Daniel Sellers) #4501 * node: allow preload modules with -i (Evan Lucas) #4696 * v8,src: expose statistics about heap spaces (`v8.getHeapSpaceStatistics()`) (Ben Ripkens) #4463 * Minor performance improvements: - lib: Use arrow functions instead of bind where possible (Minwoo Jung) #3622 - module: cache stat() results more aggressively (Ben Noordhuis) #4575 - querystring: improve parse() performance (Brian White) #4675 PR-URL: #4742
Notable changes: * events: make sure console functions exist (Dave) #4479 * fs: add autoClose option to fs.createWriteStream (Saquib) #3679 * http: improves expect header handling (Daniel Sellers) #4501 * node: allow preload modules with -i (Evan Lucas) #4696 * v8,src: expose statistics about heap spaces (`v8.getHeapSpaceStatistics()`) (Ben Ripkens) #4463 * Minor performance improvements: - lib: Use arrow functions instead of bind where possible (Minwoo Jung) #3622 - module: cache stat() results more aggressively (Ben Noordhuis) #4575 - querystring: improve parse() performance (Brian White) #4675 PR-URL: #4742
Add support to fs.createWriteStream and fs.createWriteStream for an autoClose option that behaves similarly to the autoClose option supported by fs.createReadStream and fs.ReadStream. When an instance of fs.createWriteStream created with autoClose === false finishes, it is not destroyed. Its underlying fd is not closed and it is the responsibility of the user to close it. PR-URL: nodejs#3679 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Notable changes: * events: make sure console functions exist (Dave) nodejs#4479 * fs: add autoClose option to fs.createWriteStream (Saquib) nodejs#3679 * http: improves expect header handling (Daniel Sellers) nodejs#4501 * node: allow preload modules with -i (Evan Lucas) nodejs#4696 * v8,src: expose statistics about heap spaces (`v8.getHeapSpaceStatistics()`) (Ben Ripkens) nodejs#4463 * Minor performance improvements: - lib: Use arrow functions instead of bind where possible (Minwoo Jung) nodejs#3622 - module: cache stat() results more aggressively (Ben Noordhuis) nodejs#4575 - querystring: improve parse() performance (Brian White) nodejs#4675 PR-URL: nodejs#4742
Add support to fs.createWriteStream and fs.WriteStream for an autoClose
option that behaves similarly to the autoClose option supported by
fs.createReadStream and fs.ReadStream.
When an instance of fs.WriteStream created with autoClose === false finishes,
it is not destroyed. Its underlying fd is not closed and it is the
responsibility of the user to close it.