Skip to content

Commit 1090494

Browse files
committed
doc: clarify fs.StatFs property descriptions
- statfs.bsize: specify unit is bytes - statfs.frsize: clarify it's the unit for block counts - statfs.bavail: add note on calculating available space in bytes - statfs.bfree: add note on calculating free space in bytes - statfs.type: explain the numeric identifier and platform differences Fixes: #50749
1 parent 6d954e7 commit 1090494

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

doc/api/fs.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7929,7 +7929,8 @@ added:
79297929
79307930
* Type: {number|bigint}
79317931
7932-
Free blocks available to unprivileged users.
7932+
Free blocks available to unprivileged users. To calculate the available
7933+
space in bytes, multiply `statfs.bavail` by `statfs.frsize`.
79337934
79347935
#### `statfs.bfree`
79357936
@@ -7941,7 +7942,8 @@ added:
79417942
79427943
* Type: {number|bigint}
79437944
7944-
Free blocks in file system.
7945+
Free blocks in file system. To calculate the free space in bytes,
7946+
multiply `statfs.bfree` by `statfs.frsize`.
79457947
79467948
#### `statfs.blocks`
79477949
@@ -7965,7 +7967,7 @@ added:
79657967
79667968
* Type: {number|bigint}
79677969
7968-
Optimal transfer block size.
7970+
Optimal transfer block size, in bytes.
79697971
79707972
#### `statfs.frsize`
79717973
@@ -7975,7 +7977,8 @@ added: REPLACEME
79757977
79767978
* Type: {number|bigint}
79777979
7978-
Fundamental file system block size.
7980+
Fundamental file system block size, in bytes. This is the unit used
7981+
for block counts (`statfs.blocks`, `statfs.bfree`, `statfs.bavail`).
79797982
79807983
#### `statfs.ffree`
79817984
@@ -8011,7 +8014,9 @@ added:
80118014
80128015
* Type: {number|bigint}
80138016
8014-
Type of file system.
8017+
Type of file system. This is a numeric identifier corresponding to the
8018+
file system type (e.g., `0xEF53` for ext4, `0x01021997` for tmpfs on Linux).
8019+
On Windows, this value is not meaningful.
80158020
80168021
### Class: `fs.Utf8Stream`
80178022

0 commit comments

Comments
 (0)