File descriptor
An OS handle (usually a small integer) representing an open file, socket, pipe, or similar I/O resource owned by a process.
Definition
A file descriptor is an OS-managed handle (often a small integer) that represents an open I/O resource owned by a process.
Despite the name, file descriptors aren’t just “files”. They commonly represent:
- files on disk
- network sockets
- pipes between processes
- terminals (stdout/stderr)
Why you care
Most systems cap how many file descriptors a process can have open at once. When that limit is hit, you see failures like “too many open files”, and network/file operations start breaking in surprising ways.