18 File Access and Control
A large part of every operating system seems to be concerned with data management and file management, and UNIX turns out to be no exception.
Section Four of the source code contains thirteen files.
The first four contain common declarations needed by various of the other routines:
- “file.h”
describes the structure of the “file” array;
- “filsvs.h”
describes the structure of the “super block” for “mounted” file systems;
- “ino.h”
describes the structure of “inodes” recorded on “mounted” devices;
- “inode.h”
describes the structure of the “inode” array;
The next two files, “sys2.c” and “sys3.c” contain code for system calls. (“sys1.c” and “sys4.c” were presented in Section Two).
Tne next five files, “rdwri.c”, “subr.c”, “fio.c”, “alloc.c” and “iget.c”, together present the principal routines for file management, and provide a link between the i/o oriented system calls and the basic i/o routines.
The file “nami.c” is concerned with searching directories to convert file pathnames into “inode” references.
Finally, “pipe.c” is the “device driver” for pipes.