-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
doc: adds clarification for fs constants for node < v6.3.x in fs.md #12690
doc: adds clarification for fs constants for node < v6.3.x in fs.md #12690
Conversation
doc/api/fs.md
Outdated
was `undefined` and all those constants were present directly on `fs`. Thus if | ||
you are using node version `< v6.3.x` use `fs.R_OK`, etc. | ||
|
||
Or you can do something like `(fs.constatns || fs).R_OK` to work with all versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution!
A nit: could you please wrap the line <= 80 characters according to style guide?
Also, see commit guidelines: commit title should be <= 50 characters and use imperative verb (add
) after the subsystem tag.
All this can be fixed by a collaborator who will land the PR though)
@vsemozhetbyt Thanks for review, I will take care of line lengths but how should I take care of commit message? Do I need to commit again raising new pull request? Because I don't know how I can change commit message of already pushed changes? |
@anshulguleria You can use |
1bd827e
to
3b0c076
Compare
@vsemozhetbyt Done. Thanks for help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to utilize the individual changelogs for this? It seems like the perfect use case.
doc/api/fs.md
Outdated
|
||
Although this api was added in `v0.11.15` but prior to `v6.3.x`, `fs.constants` | ||
was `undefined` and all those constants were present directly on `fs`. Thus if | ||
you are using node version `< v6.3.x` use `fs.R_OK`, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid the use of you
in the doc text. :-) ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed you
from doc.
doc/api/fs.md
Outdated
@@ -2252,8 +2261,9 @@ Synchronous versions of [`fs.write()`][]. Returns the number of bytes written. | |||
|
|||
## FS Constants | |||
|
|||
The following constants are exported by `fs.constants`. **Note:** Not every | |||
constant will be available on every operating system. | |||
The following constants are exported by `fs.constants` or `fs`(in case of node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/node/Node.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to change node
to Node
?
@anshulguleria I meant the individual changelogs in the API docs. For example, check out the |
Hi @jasnell I have done the changes requested by you. Have a look. |
Check the v7 branch - https://nodejs.org/dist/latest-v7.x/docs/api/fs.html#fs_fs_appendfile_file_data_options_callback. Specifically, look at the "History" with the little arrow next to it. |
@cjihrig Can you help me setup nodedocs locally? I am not able to find how to do it on my local machine. Because if I run those |
394af79
to
dca0572
Compare
@cjihrig Updated doc to use changelog instead of Note. |
@anshulguleria Run |
dca0572
to
4b95342
Compare
I have done the requested changes. Do I need to do something else also to get them accepted? Sorry if I am missing something basic in this process, I am new to this. |
At this point we just need to finish the review and get sign off. Quite a few of us have been busy at the collaborator summit meeting in Berlin so we haven't been as responsive as usual. I'm sure this will get a good look in the next day or two. If all looks good, it should land in a couple of days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mostly LGTM, left a few nits.
doc/api/fs.md
Outdated
- version: v6.3.0 | ||
pr-url: https://github.com/nodejs/node/pull/6534 | ||
description: The constants like `fs.R_OK`, etc which were present directly | ||
on `fs` were moved into `fs.constants` as soft a deprecation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as soft a
-> as a soft
doc/api/fs.md
Outdated
description: The constants like `fs.R_OK`, etc which were present directly | ||
on `fs` were moved into `fs.constants` as soft a deprecation. | ||
Thus for Node `< v6.3.x` use `fs` to access those constants. Or | ||
do something like `(fs.constatns || fs).R_OK` to work with all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fs.constatns
-> fs.constants
doc/api/fs.md
Outdated
pr-url: https://github.com/nodejs/node/pull/6534 | ||
description: The constants like `fs.R_OK`, etc which were present directly | ||
on `fs` were moved into `fs.constants` as soft a deprecation. | ||
Thus for Node `< v6.3.x` use `fs` to access those constants. Or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. Or
-> , or
doc/api/fs.md
Outdated
@@ -2531,8 +2538,9 @@ Synchronous versions of [`fs.write()`][]. Returns the number of bytes written. | |||
|
|||
## FS Constants | |||
|
|||
The following constants are exported by `fs.constants`. **Note:** Not every | |||
constant will be available on every operating system. | |||
The following constants are exported by `fs.constants` or `fs`(in case of Node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`fs`(
-> `fs` (
in case of
-> for
doc/api/fs.md
Outdated
The following constants are exported by `fs.constants`. **Note:** Not every | ||
constant will be available on every operating system. | ||
The following constants are exported by `fs.constants` or `fs`(in case of Node | ||
`< v6.3.x`). **Note:** Not every constant will be available on every |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe say < v6.3.0
, otherwise < v6.3.x
might be confusing.
FYI, at the moment your Git author name and email address are set to:
People usually choose to use their full names for commits. To set your name globally you can do: git config --global user.name "Anshul Guleria" To change the author for a single commit you can do: git commit --amend --author="Anshul Guleria <[email protected]>"
git push --force-with-lease If you don't want to have your name against this commit, that's fine too! |
Also it might be worth using a different example constant, as it looks like > fs
{ constants:
{ O_RDONLY: 0,
O_WRONLY: 1,
O_RDWR: 2,
S_IFMT: 61440,
S_IFREG: 32768,
S_IFDIR: 16384,
S_IFCHR: 8192,
S_IFBLK: 24576,
S_IFIFO: 4096,
S_IFLNK: 40960,
S_IFSOCK: 49152,
O_CREAT: 512,
O_EXCL: 2048,
O_NOCTTY: 131072,
O_TRUNC: 1024,
O_APPEND: 8,
O_DIRECTORY: 1048576,
O_NOFOLLOW: 256,
O_SYNC: 128,
O_SYMLINK: 2097152,
O_NONBLOCK: 4,
S_IRWXU: 448,
S_IRUSR: 256,
S_IWUSR: 128,
S_IXUSR: 64,
S_IRWXG: 56,
S_IRGRP: 32,
S_IWGRP: 16,
S_IXGRP: 8,
S_IRWXO: 7,
S_IROTH: 4,
S_IWOTH: 2,
S_IXOTH: 1,
F_OK: 0,
R_OK: 4,
W_OK: 2,
X_OK: 1 },
F_OK: 0,
R_OK: 4,
W_OK: 2,
X_OK: 1,
[...] Sorry for all the nits! |
Hi, @gibfahn I choose But if you still feel its not required I'll remove it. Thanks. |
5dc1786
to
b386905
Compare
@anshulguleria okay, that seems reasonable, and it probably makes sense to leave |
doc/api/fs.md
Outdated
constant will be available on every operating system. | ||
The following constants are exported by `fs.constants` or `fs` (in case of Node | ||
`< v6.3.0`). **Note:** Not every constant will be available on every | ||
operating system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight suggested modification:
The following constants are exported by `fs.constants` (or `fs` in case of Node.js `< v6.3.0`).
*Note*: Not every constant will be available on every operating system.
(note the slight formatting difference on the Note
part also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also change in case of
-> for
(in addition to @jasnell's suggested changes)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Handled both cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM but I do have a suggested improvement.
b386905
to
2871d6f
Compare
@cjihrig LGTY now? |
The changes starting at line 2,695 seem unnecessary to me. The changelog referencing versions below 6.3.0 also seems unnecessary (it's kind of implied by being in a changelog). |
@cjihrig I think you are right. That does seems unnecessary, and it also kind of states that all constants stated below are accessible by |
I reopened the issue that this fixes, so could you change the commit message: -Refs: https://github.com/nodejs/node/issues/8044
+Fixes: https://github.com/nodejs/node/issues/8044 that way when this PR lands it will automatically close that issue. Thanks for sticking with this! Should be good to land after this and @cjihrig's suggestion. |
* Add changelog history in `fs.access` for the changes introduced to `constants` in `fs` module prior to Node `<v6.3.0`. Fixes: nodejs#8044
2871d6f
to
6312847
Compare
@cjihrig LGTY? |
Will land this in a bit if there are no objections. |
Landed in b6e2cde, thanks for the PR @anshulguleria ! |
Add changelog history in `fs.access` for the changes introduced to `constants` in the `fs` module prior to Node v6.3.0. PR-URL: #12690 Fixes: #8044 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Add changelog history in `fs.access` for the changes introduced to `constants` in the `fs` module prior to Node v6.3.0. PR-URL: #12690 Fixes: #8044 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
This does not land cleanly in LTS. Please feel free to manually backport. Please also feel free to replace do-not-land if it is being backported |
Added NOTE in
fs.access
documentation to explain the position ofconstants(
R_OK
, etc) in fs for node versions< v6.3.x
Added clarification on
FS Constants
documentation for the same.Refs: Issue #8044
Checklist
Affected core subsystem(s)
doc