Skip to content

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

Closed
Jordan-Nguy wants to merge 1 commit into
nodejs:mainfrom
Jordan-Nguy:doc-fsstatfs
Closed

doc: added details about statfs.type and statfs.bsize#51301
Jordan-Nguy wants to merge 1 commit into
nodejs:mainfrom
Jordan-Nguy:doc-fsstatfs

Conversation

@Jordan-Nguy

Copy link
Copy Markdown

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-botnodejs-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
@Jordan-Nguy
Jordan-Nguy marked this pull request as draft January 16, 2024 08:53
@Jordan-Nguy
Jordan-Nguy marked this pull request as ready for review January 16, 2024 08:53
@Jordan-Nguy
Jordan-Nguy marked this pull request as draft January 18, 2024 23:00
@Jordan-Nguy
Jordan-Nguy marked this pull request as ready for review January 18, 2024 23:00
@aduh95

Copy link
Copy Markdown
Contributor

/cc @nodejs/fs

@LiviaMedeirosLiviaMedeiros left a comment

Copy link
Copy Markdown
Member

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:

exportconstREISERFS_SUPER_MAGIC=0x52654973;// orconstmagic2humanReadable={ ...,0x52654973: 'ReiserFS', ... };// or evenif(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.

Comment threaddoc/api/fs.md Outdated
Magic numbers from man page of statfs.
Comment threaddoc/api/fs.md
* {number|bigint}

Type of file system.
Magic number of file system in decimal.

@aduh95aduh95May 17, 2024

Copy link
Copy Markdown
Contributor

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.

Comment threaddoc/api/fs.md

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

Copy link
Copy Markdown
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`|

@Jordan-NguyJordan-Nguy closed this by deleting the head repository Sep 13, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docIssues and PRs related to the documentations.fsIssues 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

@Jordan-Nguy@aduh95@LiviaMedeiros@nodejs-github-bot