Test & document numeric flags to fs.open on unix#3641
Test & document numeric flags to fs.open on unix#3641XeCycle wants to merge 3 commits intonodejs:masterfrom
Conversation
There was a problem hiding this comment.
Use assert.throws instead
12b5803 to
053513f
Compare
doc/api/fs.markdown
Outdated
There was a problem hiding this comment.
Not just POSIX, it works on Windows too. Not all flags from require('constants') are available but the common ones are.
053513f to
9306682
Compare
There was a problem hiding this comment.
Not all users know what open(2) means. Would be nice if this was linkified to some docs on it or even better the numbers being documented here too.
There was a problem hiding this comment.
Well, there are many (2) notations in this file; do you want to linkify every one? I suppose that should be another PR anyway.
There was a problem hiding this comment.
Yes, but I can do it in another PR.
9306682 to
2abbf90
Compare
doc/api/fs.markdown
Outdated
There was a problem hiding this comment.
I'd write this as "should be opened in blocking mode".
Also, s/could/should/
There was a problem hiding this comment.
fcntl can set blocking mode after open, so imo "opened in blocking mode" may be inaccurate.
Okay will s/could/should/, not being a native speaker I have to trust you :)
|
Left some comments. @XeCycle GH doesn't send notifications for new or changed commits, better leave a comment or it won't get noticed until someone goes through the list of open pull requests (like I'm currently doing.) |
2abbf90 to
4284cd1
Compare
|
@bnoordhuis sorry am not aware of that, commenting this time. Rebased to latest master, and did s/could/should/. |
|
LGTM with a question. CI: https://ci.nodejs.org/job/node-test-pull-request/701/ |
|
@XeCycle ... this LGTM but can I ask you to please rebase and update? |
|
@jasnell will do that in 48hr. Now out on a vacation. |
4f6cb6f to
4c90d94
Compare
|
@bnoordhuis @jasnell rebased, and reworded translation on windows to say "where applicable". Please check if these still LGTY. |
|
LGTM (with a comment) |
doc/api/fs.markdown
Outdated
There was a problem hiding this comment.
Unfortunately, this last sentence is a rather unclear. I'd recommend including a bit more detail about what is translated to what...
There was a problem hiding this comment.
Ah seems a typo there, I wanted to say "where applicable". Yes, it is unclear; but details imo should go to libuv docs, but no one is taking on that. What about adding a few examples, "e.g. O_EXCL to xxx, O_RDWR to xxx..."?
There was a problem hiding this comment.
Examples would be great, I think.
4c90d94 to
62d3163
Compare
|
Added a few examples to flags translation. |
This clarifies that fs.createReadStream and fs.createWriteStream, when passed a fd, expects the fd to be blocking, and suggests net.Socket as an alternative. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This has been supperted for long but never tested nor documented. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This has been supperted for long but never tested nor documented. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This clarifies that fs.createReadStream and fs.createWriteStream, when passed a fd, expects the fd to be blocking, and suggests net.Socket as an alternative. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This has been supperted for long but never tested nor documented. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This has been supperted for long but never tested nor documented. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This clarifies that fs.createReadStream and fs.createWriteStream, when passed a fd, expects the fd to be blocking, and suggests net.Socket as an alternative. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This has been supperted for long but never tested nor documented. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This has been supperted for long but never tested nor documented. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This clarifies that fs.createReadStream and fs.createWriteStream, when passed a fd, expects the fd to be blocking, and suggests net.Socket as an alternative. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This has been supperted for long but never tested nor documented. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This has been supperted for long but never tested nor documented. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This clarifies that fs.createReadStream and fs.createWriteStream, when passed a fd, expects the fd to be blocking, and suggests net.Socket as an alternative. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This has been supperted for long but never tested nor documented. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
This has been supperted for long but never tested nor documented. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
For #3628.
Do we prefer two commits here or one? Also, shall we backport the doc commit to older versions?