How does Linux handle writes?

In this article, the author discusses the way file writes work in Linux and challenges the misconception that files live on disk. They explain that files are actually just interfaces used by the operating system to interact with the bytes that live on disk. The author highlights the slowness of disk access compared to memory access and explains how the operating system shields applications from this slowness through non-blocking IO and buffering. They also discuss the tradeoff between efficiency and durability in disk writes and mention methods like the sync syscall and O_SYNC file mode to make writes durable. The article concludes by demonstrating the asynchronous nature of file writes and encourages readers to explore the topic further.

https://www.cyberdemon.org/2023/06/27/file-writes.html

To top