v7.x backport: fs: support Uint8Array input to methods#10593
Merged
addaleax merged 1 commit intonodejs:v7.x-stagingfrom Jan 4, 2017
Merged
v7.x backport: fs: support Uint8Array input to methods#10593addaleax merged 1 commit intonodejs:v7.x-stagingfrom
addaleax merged 1 commit intonodejs:v7.x-stagingfrom
Conversation
Allow `fs.read`, `fs.write` and `fs.writeFile` to take `Uint8Array` arguments. PR-URL: nodejs#10382 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
4 tasks
Member
Author
thefourtheye
reviewed
Jan 3, 2017
| 0, | ||
| expected.length, | ||
| 0, | ||
| common.mustCall((err, bytesRead) => { |
Contributor
There was a problem hiding this comment.
Could you assert the error here?
thefourtheye
reviewed
Jan 3, 2017
| fs.closeSync(fd); | ||
|
|
||
| const found = fs.readFileSync(filename, 'utf8'); | ||
| assert.deepStrictEqual(expected.toString(), found); |
Contributor
There was a problem hiding this comment.
Strings don't need deep comparison, right?
Member
Author
|
@thefourtheye I’ll be happy to address your suggestions, but I’d prefer to do that on |
thefourtheye
approved these changes
Jan 3, 2017
Contributor
thefourtheye
left a comment
There was a problem hiding this comment.
@addaleax Sure, no problem. LGTM, if the CI is happy.
Member
Author
|
@evanlucas I guess whether you want to have this in #10589 is your call? I don’t want to step on anybody’s toes by landing this at the wrong time |
Contributor
|
@addaleax feel free to land it. I was planning on bringing it any anyways :] |
3 tasks
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow
fs.read,fs.writeandfs.writeFileto takeUint8Arrayarguments.PR-URL: #10382
The only difference from the original commit is the added line in
node_util.cc/cc @evanlucas