previous | start | next

Linux I/O: open

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:



previous | start | next