Organization of the file system
Some operations to the files. In the previous chapter lists the basic operations
on files. This section will describe the modus operandi of some system calls to
work with the file system, following mainly in the light together, imposed in
this chapter concepts. Systemic challenges of working with the symbolic name of
the file. System Challenges linking pathname to the file descriptor It features
and open it. For example, the Unix OS fd = creat (pathname, modes); fd = open (pathname,
flags, modes); Other operations to the files, such as read, write, read-write
head positioning, reproduction descriptor file, the installation of I / O
parameters, the definition of the status of the file and the closure of the file,
use the value received descriptor file. Consider the work of open system call.
Logical file subsystem scans the file system in search of the file on his behalf.
It checks the right to open a file and provides open file table entry files.
Writing tables file contains a pointer to knot the index file open. The kernel
provides personal record in the table (closed) in the address space of the
process, highlighted the process (see table, this table is called a custom file
descriptors), and stores a pointer to this entry. The index stands file
descriptor returned by the user. Writing in the table of user files indicates
record in the global table files. The first three user descriptor (0, 1 and 2)
called descriptor files: standard input, standard output, and standard error
file. The processes in the system used by agreement UNIX file descriptor entry
while reading standard input, standard output file descriptor while writing and
the output file descriptor standard errors for writing error messages. Tying
File System function link connects file with a new name in the file system
directory structure, creating a new index for the existing entry in the
directory. Syntax function call link: link (source file name, target file name);
where the source file name, the name of an existing file, and target file name
is a new (additional) name given to a file after the function link. First OS
determines the location of the source file and the index increases inflated
links in the index node. Then, the kernel looks for a file with a new name, if
it exists, the function failed link is completed and restores the old kernel
Next part
|