File descriptor

File descriptors for a single process, file table and inode table. Note that multiple file descriptors can refer to the same file table entry (e.g., as a result of the dup system call) and that multiple file table entries can in turn refer to the same inode (if it has been opened multiple times; the table is still simplified because it represents inodes by file names, even though an inode can have multiple names). File descriptor 3 does not refer to anything in the file table, signifying that it has been closed.

Unique identifier (handle) for a file or other input/output resource, such as a pipe or network socket.

- File descriptor

114 related topics

Relevance

System resource

Any physical or virtual component of limited availability within a computer system.

Computer simulation, one of the main cross-computing methodologies.

Virtual system resources include files (concretely file handles), network connections (concretely network sockets), and memory areas.

Process (computing)

Instance of a computer program that is being executed by one or many threads.

400x400px
A list of processes as displayed by htop
A process table as displayed by KDE System Guard
The various process states, displayed in a state diagram, with arrows indicating possible transitions between states.

Operating system descriptors of resources that are allocated to the process, such as file descriptors (Unix terminology) or handles (Windows), and data sources and sinks.

Daemon (computing)

Computer program that runs as a background process, rather than being under the direct control of an interactive user.

Components of some Linux desktop environments that are daemons include D-Bus, NetworkManager (here called unetwork), PulseAudio (usound), and Avahi.

Redirecting file descriptors 0, 1 and 2 for the standard streams (stdin, stdout and stderr) to /dev/null or a logfile, and closing all the other file descriptors inherited from the parent process.

Network socket

Software structure within a network node of a computer network that serves as an endpoint for sending and receiving data across the network.

250px

In Unix-like operating systems, this descriptor is a type of file descriptor.

Standard streams

In computer programming, standard streams are interconnected input and output communication channels between a computer program and its environment when it begins execution.

206x206px

The file descriptor for standard input is 0 (zero); the POSIX definition is ; the corresponding C variable is ; similarly, the C++ variable is.

Handle (computing)

Not to be confused with Handlers.

Ada Lovelace, whose notes added to the end of Luigi Menabrea's paper included the first algorithm designed for processing by an Analytical Engine. She is often recognized as history's first computer programmer.

Common resource handles include file descriptors, network sockets, database connections, process identifiers (PIDs), and job IDs.

Unix domain socket

Similar to that of an Internet socket, but rather than using an underlying network protocol, all communication occurs entirely within the operating system kernel.

A diagram from 1978 proposing the expansion of the idea of the API to become a general programming interface, beyond application programs alone.

In addition to sending data, processes may send file descriptors across a Unix domain socket connection using the and system calls.

Pipeline (Unix)

Mechanism for inter-process communication using message passing.

A pipeline of three program processes run on a text terminal

The pipe ends appear to be normal, anonymous file descriptors, except that they have no ability to seek.

Computer file

Computer resource for recording data in a computer storage device, primarily identified by its file name.

A punched card file
The twin disk files of an IBM 305 system
Files and folders arranged in a hierarchy

As seen by a running user program, files are usually represented either by a file control block or by a file handle.

Device file

Interface to a device driver that appears in a file system as if it were an ordinary file.

A simplified structure of the Linux kernel. File systems are implemented as part of the I/O subsystem.

fd: (platform) floppy disks, though this same abbreviation is also commonly used to refer to file descriptor