You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constfreeSpace=stats.bsize*stats.bfree; // free space in bytes
7544
+
console.log(`Free space: ${freeSpace} bytes`);
7545
+
}
7546
+
7547
+
getFreeSpace("/tmp");
7548
+
```
7549
+
7524
7550
#### `statfs.blocks`
7525
7551
7526
7552
<!-- YAML
@@ -7533,6 +7559,18 @@ added:
7533
7559
7534
7560
Total data blocks in file system.
7535
7561
7562
+
**Example:**
7563
+
```javascript
7564
+
import { statfs } from"fs/promises";
7565
+
7566
+
asyncfunctiongetTotalBlocks(path) {
7567
+
conststats=awaitstatfs(path);
7568
+
console.log(`Total blocks: ${stats.blocks}`);
7569
+
}
7570
+
7571
+
getTotalBlocks("/tmp");
7572
+
```
7573
+
7536
7574
#### `statfs.bsize`
7537
7575
7538
7576
<!-- YAML
@@ -7543,7 +7581,7 @@ added:
7543
7581
7544
7582
* {number|bigint}
7545
7583
7546
-
Optimal transfer block size.
7584
+
Optimal transfer block size in bytes.
7547
7585
7548
7586
#### `statfs.ffree`
7549
7587
@@ -7569,6 +7607,17 @@ added:
7569
7607
7570
7608
Total file nodes in file system.
7571
7609
7610
+
```javascript
7611
+
import { statfs } from"fs/promises";
7612
+
7613
+
asyncfunctiongetTotalFiles(path) {
7614
+
conststats=awaitstatfs(path);
7615
+
console.log(`Total file nodes: ${stats.files}`);
7616
+
}
7617
+
7618
+
getTotalFiles("/tmp");
7619
+
```
7620
+
7572
7621
#### `statfs.type`
7573
7622
7574
7623
<!-- YAML
@@ -7579,7 +7628,8 @@ added:
7579
7628
7580
7629
* {number|bigint}
7581
7630
7582
-
Type of file system.
7631
+
Type of file system.
7632
+
This numeric value represents the file system type (e.g., EXT4, NTFS, etc.). The specific value can be interpreted by referring to platform-specific documentation or using a lookup table.
0 commit comments