File Descriptors

Explains Linux File Descriptor

Jul 13, 2025

When we think of a file, we typically picture a regular file in data storage, a collection of bytes written to a disk.

However, in Unix/Linux, everything is treated as a file. This abstraction simplifies how the operating system interacts with various resources. Whether it’s a standard file, a network socket, a directory, a symbolic link, or a device, the OS can perform the same basic operations: open, read, write, and close.

A file descriptor is simply a reference to any open resource. When a process opens a resource, the kernel creates a file descriptor as an interface for communication, allowing the process to perform operations on it.

File Descriptor
https://stackoverflow.com/a/73406557/6318257