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

doc: added details about statfs.type and statfs.bsize #51301

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DrowningWhale
Copy link

Added byte unit to statfs.bsize description. Added statfs.type list of potential values pulled from man page of statfs on Linux.

Fixes: #50749

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system. labels Dec 28, 2023
@DrowningWhale DrowningWhale marked this pull request as draft January 16, 2024 08:53
@DrowningWhale DrowningWhale marked this pull request as ready for review January 16, 2024 08:53
@DrowningWhale DrowningWhale marked this pull request as draft January 18, 2024 23:00
@DrowningWhale DrowningWhale marked this pull request as ready for review January 18, 2024 23:00
@aduh95
Copy link
Contributor

aduh95 commented May 12, 2024

/cc @nodejs/fs

Copy link
Contributor

@LiviaMedeiros LiviaMedeiros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! The changes LGTM with the following nit.

The decimal part might be redundant: usually users can use hex values directly:

export const REISERFS_SUPER_MAGIC = 0x52654973;
// or
const magic2humanReadable = { ..., 0x52654973: 'ReiserFS', ... };
// or even
if (statfsBigInt.type === 0x52654973n) { // reiserfs

I would suggest adding a link to statfs(2) manpage instead of pasting the whole table here.
This way, we won't have to update the list every time a new fs emerges.

doc/api/fs.md Show resolved Hide resolved
Magic numbers from man page of statfs.
@@ -7568,7 +7568,101 @@ added:

* {number|bigint}

Type of file system.
Magic number of file system in decimal.
Copy link
Contributor

@aduh95 aduh95 May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not in decimal, it's just.. a number (if anything it's in binary, or IEEE 754).

Suggested change
Magic number of file system in decimal.
Magic number of file system.


| Filesystem Type | Hexadecimal | Decimal |
| ----------------------- | ------------ | ------------ |
| ADFS\_SUPER\_MAGIC | `0xadf5` | `44533` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it would be more readable to wrap those in ticks

Suggested change
| ADFS\_SUPER\_MAGIC | `0xadf5` | `44533` |
| `ADFS_SUPER_MAGIC` | `0xadf5` | `44533` |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing documentation in fs.StatFs
4 participants