0% found this document useful (0 votes)
29 views

File Descriptor

A file descriptor is an integer that represents an opened file in the operating system, with different file descriptors representing different opened files. File descriptors 0, 1, and 2 represent standard input, standard output, and standard error respectively for each running process.

Uploaded by

Nenad Femic
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

File Descriptor

A file descriptor is an integer that represents an opened file in the operating system, with different file descriptors representing different opened files. File descriptors 0, 1, and 2 represent standard input, standard output, and standard error respectively for each running process.

Uploaded by

Nenad Femic
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

File descriptor

In simple words, when you open a file, the operating system creates an entry to represent that file and store
the information about that opened file. So if there are 100 files opened in your OS then there will be 100
entries in OS (somewhere in kernel). These entries are represented by integers like (...100, 101, 102....).
This entry number is the file descriptor. So it is just an integer number that uniquely represents an opened
file in operating system. If your process opens 10 files then your Process table will have 10 entries for file
descriptors.

Similarly when you open a network socket, it is also represented by an integer and it is called Socket
Descriptor.

File descriptors 0, 1, and 2 are standard input, standard output, and standard error for each running process

You might also like