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.chmod documentation 8.x & 9.x : The value of "mode" is not an "integer" #1545

Closed
warlock opened this issue Jan 5, 2018 · 2 comments
Closed

Comments

@warlock
Copy link

warlock commented Jan 5, 2018

https://nodejs.org/dist/latest-v8.x/docs/api/fs.html#fs_fs_chmod_path_mode_callback
https://nodejs.org/dist/latest-v9.x/docs/api/fs.html#fs_fs_chmod_path_mode_callback

The "mode" value on the web is a "whole number". But sometimes you need an "octal". "number is the correct type in javascript.

Thank you.

@warlock warlock changed the title fs.chmod documentation: The value of "mode" is not an "integer" fs.chmod documentation 8.x & 9.x : The value of "mode" is not an "integer" Jan 5, 2018
@tniessen
Copy link
Member

tniessen commented Jan 5, 2018

Octals (0755) are integers, so I don't really get the problem. The type number includes integers and floating point numbers, so why would number be more appropriate than integer?

@warlock
Copy link
Author

warlock commented Jan 5, 2018

He thought that the "integer" type does not exist in js and the official type was "number".

I found that it uses the word "integer" in js:
Number.isSafeInteger(0o777) -> true
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants