Skip to content

Conversation

@ronag
Copy link
Member

Minor fixes found while reviewing code. I don't plan on working further on this so if someone wants to finish up with the test be my guest.

@ronagronag added the good first issue Issues that are suitable for first-time contributors. label Dec 19, 2022
@nodejs-github-botnodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Dec 19, 2022
ronag referenced this pull request Dec 19, 2022
Support creating a Read/WriteStream from a FileHandle instead of a raw file descriptor Add an EventEmitter to FileHandle with a single 'close' event. Fixes: #35240 PR-URL: #35922 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]>
@ronagronag requested a review from aduh95December 25, 2022 11:12
@ronagronag marked this pull request as ready for review December 25, 2022 11:12
@ronagronag removed the good first issue Issues that are suitable for first-time contributors. label Dec 25, 2022
@ronag
Copy link
MemberAuthor

ronag commented Dec 25, 2022

@nodejs/fs @mcollina

thrownewERR_METHOD_NOT_IMPLEMENTED('open()');
},
close: (fd,cb)=>{
handle.off('close',closeHandler);
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Avoid keeping stream alive until file handle is closed.

()=>cb(),cb);
if(handle[kFd]!==-1){
// Someone else has a ref to the handle.
process.nextTick(cb);
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

stream can finish teardown even if file handle isn't closed, if it has refs

()=>{this[kClosePromise]=undefined;}
()=>{
this[kClosePromise]=undefined;
this.emit('close');
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Only emit close after actually closing.

@ronagronag added the review wanted PRs that need reviews. label Jan 1, 2023
@Slayer95
Copy link
Contributor

I'm afraid this PR flew under people's radar.

Copy link
Contributor

@aduh95aduh95 left a comment

Choose a reason for hiding this comment

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

LGTM except the test failures

Copy link
Contributor

@aduh95aduh95 left a comment

Choose a reason for hiding this comment

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

LGTM except the test failures

@ronagronag closed this Apr 8, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fsIssues and PRs related to the fs subsystem / file system.needs-ciPRs that need a full CI run.review wantedPRs that need reviews.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@ronag@Slayer95@aduh95@nodejs-github-bot