Organization of the file system
In other systems (Multics) entire body of files and directories as a single tree.
The very system you search files by name, starting with the roots, demanded the
installation of the necessary discs. In the Unix OS to be several archives files,
each in their section, which is considered one of the root. After starting the
system can "mount" a root file system, and a number of separate file systems in
a common file system. Technically, this is done through institutions in the root
file system of special empty directories (see also the next chapter). Special
systemic challenge to "mount" UNIX OS allows connecting to one of these empty
directories root directory specified archive files. After mounting a common file
system for naming files produced in the same manner as if it had been from the
very beginning centralized. The task OS is a free passage mount point in gaining
access to the file through a chain of names. Given that usually mount the file
system is subject detail system, the UNIX operating system, users and usually
not thinking about the common origin of the source file system. Operation over
directories Just as in the case files, the system is obliged to provide a set of
user operations required for working with directories, sold through the system
calls. Despite the fact that the directory is a file, the logic of working with
them is different from the logic of working with a regular file, and determine
the nature of these objects, designed to maintain the structure file archive.
The combination of system calls for the management of the directory depends on
the specific features of the OS. Consider the example of some OS Unix system
calls. Create. Creating a directory. The newly created directory includes
recordings with the names'. ''..', And it is considered empty. Delete.
Removing a directory. Removal can be only an empty directory. Opendir. Opening
a directory for later reading. For example, to list the files that are included
in the directory should open a directory and take the names of all the files
that it includes. Closedir. Closing the directory after its release reading
for places in the interior of system tables. Readdir. This challenge to the
system returns the contents of the current account in an open directory.
Generally speaking, for these purposes can be used Read systemic challenge, but
in this case the programmer will need knowledge of the internal structure of the
directory. Readdir returns the contents of records in a standard format,
regardless of the directory structure used. Rename. Directory names can be
changed, as well as the names of files. Link. Tying-technology, which allows
information about the file appear in more than one directory. This system
connects the call to an existing file with the absolute name directory, using
them as parameters. Through Call Link can be traced to a file at once with
multiple directories. Unlink. Deleting records on file from the directory. If
you want to delete a file is present in only one directory, it is generally
removed from the file system, otherwise the system is limited only by removing
the spetsifitsiruemoy record.
Next part
|