To read a file using Linux I/O functions, the file must first be opened.
Instead of fopen, the Linux open function is used.
The open function returns a value of type int, instead of the FILE * type returned by the C standard library fopen function.
The integer returned is called a file descriptor.
When a C program runs, 3 files are opened by default:
- standard input (default file is no file, just the keyboard input)
- standard output (default file is no file, just the terminal output)
- standard error (default is same as standard output)