Skip to content

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

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

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

Conversation

@Jordan-Nguy
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
@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
Contributor

aduh95 commented May 12, 2024

/cc @nodejs/fs

Copy link
Member

@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.

Magic numbers from man page of statfs.
* {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` |

@Jordan-Nguy Jordan-Nguy closed this by deleting the head repository Sep 13, 2024
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