File System

Every topic in this chapter, free to read online. Work through them in order, or jump straight to the runtime detail you need.

Start with the first topic4.1 File Descriptors & Handles
04chapter
5topics
Freeonline

Topics

5 topics

File Descriptors & Handles

How file descriptors and FileHandle objects map to OS file state, open flags, close behavior, libuv work, and EMFILE failures.

File I/O

How Node.js reads and writes files through whole-file helpers, streams, low-level read/write calls, append mode, and durable flushes.

fs.promises & FileHandle

How fs.promises and FileHandle work in Node.js, including async file operations, descriptor ownership, stream lifecycles, cleanup, and controlled concurrency.

fs.watch & Atomic Writes

How fs.watch, fs.watchFile, OS watcher backends, and atomic replacement patterns interact in real file workflows.

Permissions & Metadata

How Node.js exposes file permissions, ownership, stat metadata, symlinks, inodes, sparse files, special paths, and filesystem edge cases.