Skip to content

fs: Fix default params for fs.write(Sync) (backport to v6) - #13179

Closed
papandreou wants to merge 1 commit into
nodejs:v6.x-stagingfrom
assetgraph:backport/fix/defaultParameterForFsWriteWithBuffer
Closed

fs: Fix default params for fs.write(Sync) (backport to v6)#13179
papandreou wants to merge 1 commit into
nodejs:v6.x-stagingfrom
assetgraph:backport/fix/defaultParameterForFsWriteWithBuffer

Conversation

@papandreou

@papandreoupapandreou commented May 23, 2017

Copy link
Copy Markdown
Contributor

(Backported from #7856 to v6.x-staging, requested by @sam-github on #7856 (comment))

Add support for fs.write(fd, buffer, cb) and fs.write(fd, buffer, offset, cb)
as documented at
https://nodejs.org/api/fs.html#fs_fs_write_fd_data_position_encoding_callback
and equivalently for fs.writeSync

Update docs and code comments to reflect the implementation.

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

fs

@nodejs-github-botnodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. v6.x labels May 23, 2017
@papandreou

Copy link
Copy Markdown
ContributorAuthor

There's something up with my C++ compiler, so I wasn't able to test it. However, the cherry-pick applied cleanly except for some minor conflicts in the tests, so I think there's a good chance it'll pass on CI in this state.

@papandreoupapandreou mentioned this pull request May 23, 2017
3 tasks
@MylesBorins

Copy link
Copy Markdown
Contributor

should this be semver-minor?

@gibfahn

Copy link
Copy Markdown
Member

There are three comments in #7856 that say that it should be semver-minor, so I'd say yes.

@gibfahngibfahn added the semver-minor PRs that contain new features and should be released in the next minor version. label May 30, 2017
@gibfahn
gibfahnforce-pushed the v6.x-staging branch 3 times, most recently from 6ef8c5b to 4c2fa3dCompareJune 20, 2017 19:04
@MylesBorins
MylesBorinsforce-pushed the v6.x-staging branch 6 times, most recently from f9419c2 to 403c465CompareAugust 16, 2017 18:43
@MylesBorins
MylesBorinsforce-pushed the v6.x-staging branch 2 times, most recently from aaf4e13 to 31f572cCompareSeptember 5, 2017 16:50
(Backported from nodejs#7856 to v6.x-staging)
Add support for fs.write(fd, buffer, cb) and fs.write(fd, buffer, offset, cb)
as documented at
https://nodejs.org/api/fs.html#fs_fs_write_fd_data_position_encoding_callback
and equivalently for fs.writeSync
Update docs and code comments to reflect the implementation.
@papandreou
papandreouforce-pushed the backport/fix/defaultParameterForFsWriteWithBuffer branch from c542b2c to 93e9752CompareSeptember 18, 2017 15:33
@papandreou

Copy link
Copy Markdown
ContributorAuthor

Rebased and fixed conflicts.

@Fishrock123

Copy link
Copy Markdown
Contributor

This change affected someone: #10242

Seems like it could cause some interruption if backported, though it would ideally be a good fix.

@papandreou

Copy link
Copy Markdown
ContributorAuthor

I still think it's likely to save more trouble than it's causing, but OTOH it doesn't seem like there's a lot of interest getting this backport landed. I don't care much myself, as all my projects are using at least 7.10.1 in production.

@BridgeAR

Copy link
Copy Markdown
Member

@MylesBorins as you are mainly handling the v6 backports, PTAL

@MylesBorins

Copy link
Copy Markdown
Contributor

@nodejs/release has anyone had a chance to review this to confirm if we want to land it or not?

As @Fishrock123 mentioned above this has caused regressions in the past

@gibfahn

Copy link
Copy Markdown
Member

As @Fishrock123 mentioned above this has caused regressions in the past

Looking at #10242 (comment), it looks like the one user who raised this was trying to work out why the behaviour was wrong in the older version (it worked on 7.2.0 but is broken on 7.1.0). So I'd be +1 on this landing.

Before if you didn't provide the length the write would fail, now it succeeds.

MylesBorins pushed a commit that referenced this pull request Oct 16, 2017
Add support for fs.write(fd, buffer, cb) and fs.write(fd, buffer, offset, cb)
as documented at
https://nodejs.org/api/fs.html#fs_fs_write_fd_data_position_encoding_callback
and equivalently for fs.writeSync
Update docs and code comments to reflect the implementation.
Backport-PR-URL: #13179
PR-URL: #7856
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
@MylesBorins

Copy link
Copy Markdown
Contributor

landed in 968e564

MylesBorins pushed a commit that referenced this pull request Oct 25, 2017
Add support for fs.write(fd, buffer, cb) and fs.write(fd, buffer, offset, cb)
as documented at
https://nodejs.org/api/fs.html#fs_fs_write_fd_data_position_encoding_callback
and equivalently for fs.writeSync
Update docs and code comments to reflect the implementation.
Backport-PR-URL: #13179
PR-URL: #7856
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
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.semver-minorPRs 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.

6 participants

@papandreou@MylesBorins@gibfahn@Fishrock123@BridgeAR@nodejs-github-bot