File Descriptor Article Index for
File
Website Links For
File
 

Information About

File Descriptor




The term "file descriptor" is generally used in POSIX Operating System s. In Microsoft Windows terminology and in the context of the C Standard I/O Library , "file handle" is preferred, though the standard I/O library file handle is technically a different object (see below).

In POSIX, a file descriptor is an Integer , specifically of the C type int. There are 3 standard POSIX file descriptors which presumably every process (save perhaps a Daemon ) should expect to have:

Generally, a file descriptor is an Index for an entry in a Kernel -resident data structure containing the details of all open files. In POSIX this data structure is called a file descriptor table, and each process has its own file descriptor table. The user application passes the abstract key to the kernel through a System Call , and the kernel will access the file on behalf of the application, based on the key. The application itself cannot read or write the file descriptor table directly.

In Unix-like systems, file descriptors can refer to files, Directories , Block or Character Device s (also called "special files"), Socket s, FIFO s (also called Named Pipe s), or unnamed Pipe s.

  • file handle in the C standard I/O library routines is technically a pointer to a data structure managed by those library routines; one of those structures usually includes an actual low level file descriptor for the object in question on Unix-like systems. Since ''file handle'' refers to this additional layer, it is not interchangeable with ''file descriptor''.