File Descriptors

What is a File Descriptors

A file descriptor is simply a non-negative integer that the opreting system uses to identify an open file or I/O resources. in linux eveything is treating as a file, including a regular file, pipes, sockets, and devices. Every process starts with three standard file descriptor.

0 – stdin (standard input)

1 – stdout (standard output)