Skip to content
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

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

Conversation

papandreou
Copy link
Contributor

@papandreou papandreou commented May 23, 2017

(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-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. v6.x labels May 23, 2017
@papandreou
Copy link
Contributor Author

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.

@MylesBorins
Copy link
Contributor

should this be semver-minor?

@gibfahn
Copy link
Member

gibfahn commented May 30, 2017

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

@gibfahn gibfahn added the semver-minor PRs that contain new features and should be released in the next minor version. label May 30, 2017
@gibfahn gibfahn force-pushed the v6.x-staging branch 3 times, most recently from 6ef8c5b to 4c2fa3d Compare June 20, 2017 19:04
@MylesBorins MylesBorins force-pushed the v6.x-staging branch 6 times, most recently from f9419c2 to 403c465 Compare August 16, 2017 18:43
@MylesBorins MylesBorins force-pushed the v6.x-staging branch 2 times, most recently from aaf4e13 to 31f572c Compare September 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 papandreou force-pushed the backport/fix/defaultParameterForFsWriteWithBuffer branch from c542b2c to 93e9752 Compare September 18, 2017 15:33
@papandreou
Copy link
Contributor Author

Rebased and fixed conflicts.

@Fishrock123
Copy link
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
Contributor Author

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
Member

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

@MylesBorins
Copy link
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
Member

gibfahn commented Oct 10, 2017

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
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 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.

6 participants