3.5. close FunctionAn open file is closed by calling the close function.
Closing a file also releases any record locks that the process may have on the file. We'll discuss this in Section 14.3. When a process terminates, all of its open files are closed automatically by the kernel. Many programs take advantage of this fact and don't explicitly close open files. See the program in Figure 1.4, for example. |