File Attributes The term "file" includes not only the stored data and the name
and attributes. Attributes are described properties of the file. Examples of
file attributes: file type (normal file, directory, a special file, etc.);
The owner of the file; creator of the file; password for the file;
Information on the operation of authorized access to the file; time of
creation, last access, and the last change; current file size; The maximum
file size; The sign read-only; Token "hidden file"; token "system file";
sign "backup"; Token "binary / character"; Token "temporary" (removed after);
Token lock; length record in the file; pointer to key in your field; The
length of the key. Set file attributes defined by the specific file system: in
file systems to describe different types of files can be different sets of
attributes. For example, file systems that support unstructured files, it is not
necessary to use the last three in the list of attributes associated with the
file structure. In single OS in recruiting attributes will not characteristics
that are relevant to users and protection, such as the owner of the file, the
creator of the file, the password for the file of authorized access to the file.
The user can gain access to the attributes, using funds provided for that
purpose file system. Normally allowed to read any of the attributes, and change -
just some. For example, the user can change the access rights to the file (provided
that he has the necessary powers), but change the date of the current file size,
or it is not allowed. Attribute values are files can be directly included in the
directory, as in the MS-DOS file system (Figure 7.6, a). The picture presented
of the entries in the directory containing a mere symbolic name and attributes
of a file. Here letters of the file marked: R-read-only archive-A, N-hidden, S-Systems.
Another option is to place special attributes to the table when the directories
contain only links to these tables. This is implemented, for example, the file
system ufs UNIX OS. In this file system directory structure is very simple.
Writing about each file contains a brief symbolic name and a local index
descriptor file, so called in ufs table, which focused attributes of the file (Figure
7.6, b). In both versions of catalogs serve as a link between the names of files
and the actual files. However approach where filename is separated from his
attributes, make the system more flexible. For example, a file can be easily
incorporated across multiple directories. Record of the file in different
directories can contain different names simple, but in the links will contain
the same number of index descriptor.
Logical organization of the file Generally, the data contained in the file are
some logical structure. This structure is the basis for the development
programme for the processing of these data. For example, the text can be
properly displayed, the program must be able to identify words, lines,
paragraphs, etc. signs, separating one structural element from another, can be
certain code sequence, or simply known program of shifting these structural
elements from the beginning of the file. Maintaining data structure can be
either entirely the responsibility of the application, or in varying degrees,
the job can take a file system. In the first case, where all actions related to
the structure and interpretation of the contents of the file is the
responsibility of the application file to FS unstructured data consistency.
Annex make requests to the file system I / O using common to all applications of
the system, for example, says the shift from the beginning of the file and the
number of bytes to be considered or write. Applications received by the flow of
bytes interpreted in accordance with the laid down in the program logic. For
example, the compiler generates, and the editor of the links takes quite some
object module format of the programme. This file, which is stored object module,
known only to those programmes. It should be stressed that the interpretation of
the data is unrelated to the actual method of storage in the file system. The
model file, in which the contents of the file to unstructured sequence of bytes
(flow), has become popular with the UNIX OS, and now it is widely used in most
modern operating systems, including MS-DOS, Windows NT/2000, NetWare.
Unstructured model file makes it easy to share files between multiple
applications: different applications can have their own structure and interpret
the data contained in the file. Another model file, which was used in the OS/360
operating system, RSX and DEC VMS, and is currently being used infrequently, is
a structured file. In this case, the maintenance of the file requested the file
system. Filesystem sees file as an orderly sequence of logical records. An
application can contact FS asking for the I / O level on record, such as "take
note of the file FILE.DOC 25. FS should have information on the structure of the
file, enough to make any record. FS provides application access to records, and
all further processing of the data contained in the record, running applications.
The development of this approach are database management systems (DBMS) that
supports not only complex data structure, but also the relationship between them.
Logical record is the smallest element of data that can operate programmer in
the exchange with the outside device. Even if the physical exchange of the
product is great unit, the operating system should provide access to a
programmer logical record. File system can use two ways to access the logical
record: read or write to the logical record (serial access) or position on file
with the record number (direct access). Obviously, the OS may not support all
the possible ways of structuring data in the file, so in the OS, which is a
support logical file structure, there is a small number of pervasive pattern of
logical file. These include ways of structuring data in the form of records,
long kept in a file (Figure 7.7, a). In this case, access to the Nth record
either through consistent reading (n-1) prior record, or directly to the address
computed its serial number. For example, if L is the length of the list, the
initial address Nth record is Lxn. Note that in a logical organization of the
size of your Fixed in the file, a list of different files belonging to the same
file system, may have a different size. Another way is to structure the data in
a sequence of records, which varies within the same file. If the rank of record
length as shown in Fig. 7.7 b, the right to search your system must consistently
take all previous records. Calculate your address in its records in a number of
logical file is not possible, and therefore, can not be applied more effective
method of direct access. The files, access to records which are consistently on
the numbers of positions, known as non - or consistent. Other types of files are
indexed files, they allow more rapid direct access to a logical record. In an
indexed file (Figure 7.7 in) records have one or more key (index) fields and can
be addressed by specifying the values of these fields. For fast retrieval of
data in an indexed file to a special index table, which znacheniyam- key fields
is in line to the external memory. This address can specify either directly to
the original recordings, or some of the external memory occupied by several
accounts, which include the original recording. In the latter case, saying that
the file has indeksno-coherent organization, as well as search includes two
parts: direct access to the index of the disk area, and then consistent viewing
records in this area. Maintaining index table assumes the file system. Clearly,
the record is indexed files can be arbitrarily long. All of the above applies
more to a normal files, which can be as structured or unstructured. As for other
types of files, they have some structure, known file system. For example, the
file system must understand the structure of the data stored in the file
directory or file type "symbolic link". The physical organization of the file
system Introduction of user file system organized as a hierarchical set of
information has little to do with the storage of files on the disk. File with a
seamless manner, continuous set of bytes actually very often scattered "Pieces"
to drive, a split has nothing to do with the logical structure of a file, such
as its single logical record can be located in adjacent sectors of the disk.
Logically, the combined files from one directory is not obliged to coexist on
the disk. Principles of files, directories and system information on the real
physical devices described by the file system. Obviously, different file systems
have different physical organization. CDs, sects, sectors, clusters The main
type of device, which is used in modern computer systems for storing files are
disk drives. These devices are intended for reading and writing data on hard and
flexible magnetic disks. Hard disk consists of one or more glass or metal plates,
each of which is covered on one or two sides of magnetic material. Thus, the
drive generally consists of a set of plates (Figure 7.8). On each side of each
plate marked with thin concentric ring-track (traks), which stores data. The
number of tracks depends on the type of disc. Numbering tracks is 0-from the
outer edge to the centre of the disk. When the disk rotates, a component called
the ball, reads the binary data from the magnetic track, or write them on a
magnetic track. The head positions can be given on track. Heads move above the
disk of discrete steps, each step with the shift at one track. Disk taking
advantage of the ability to change the magnetic properties of the ball track. In
some drives along each surface moves one head, while others had to head for each
track. In the first case, searching head should move radius of the disk. Usually,
all heads attached to the one handling mechanism and moving synchronously.
Therefore, when the head is fixed at a given track surface, the rest stop on the
head track with the same numbers. In those cases where each track is a separate
head, no head movement from one track to another is not required by this saved
time spent searching for data. All tracks of a radius on all surfaces of the
plates package called cylinder (cylinder). Each track is divided into sections,
called sectors (sectors), or blocks (blocks), so that all tracks have the same
number of sectors, which could be possible to write the same number bayt1.
Branch is fixed for a specific system size in terms of dvoyki. Most sector size
is 512 bytes. Given that track different radius have the same number of sectors,
recording density becomes higher than the closest track to the center. 1
Sometimes external track is a few sectors, for the replacement of damaged
sectors in hot backup mode. Sector-addressed smallest unit of data from the
operational disk device memory. To controller on the disk to find the desired
sector, it is necessary to ask him all the sector addresses: Room cylinder
number and the number of sectors. Because applications are generally not needed
sector, a number of bytes, not necessarily the size of multiple sector, the
typical request includes reading several sectors that contain the required
information, and one or two sectors, in addition to providing the required
redundant data (Fig. 7 .9). The operating system with disk uses typically own
unit of disk space, called cluster (cluster) 1. When you create a file disk
space allocated to it clusters. For example, if the file size is 2560 bytes, and
the cluster size in the file system established in 1024 bytes, the file will be
available on disk 3 cluster. Sometimes referred to as cluster 1 block (such as
Unix OS), which could lead to advances terminal confusion. Generally, the
terminology used in describing formats disks and file systems, depending on the
hardware platform (RISC, Wintel, etc.) and the operating system. This should be
viewed and interpreted in terms depending on the context. Tracks and sectors
created as a result of the procedure, physical, or low-level, format the disk
before using the disk. To determine the boundaries of blocks on the disk
recording identifying information. Low-disk format is not dependent on the type
of operating system that the drive will be used. Disk Partitioning of a file
system type of procedure performed high level, or logical, formatting. In high
level formatting is the cluster size on disk and written information needed for
the file system, including information on available and unused space, the border
areas designated by the files and directories, information on the damaged areas.
In addition, the disk operating system boot record is a small program, which
begins the process of initializing the operating system after the power or
restart the computer. Before formatting of a disk file system, it can be divided
into sections. Section is a continuous part of the physical disk to the
operating system is user as a logical device (also used the name logical disk
and logical partition) 1. The logic device operates as if it were a separate
physical disk. It works with logical device user, referring to the name of a
character, using, for example, refer to A, B, C, SYS, etc. Operating systems use
a different type for all of these sections, but it is based on a logical device
specific to each type of OS. As a file system, which operates one OS, is not in
general can be interpreted different type of OS, logical device can be used
operating systems of different types. Each logical device can be only one file
system. 1 In many operating systems, uses the term "that" (volume). Different OS
interpretation of the term has its nuances, but most often refers to logical
device, formatted under specific file system. In private, when all the disk
covered one section, logical device is a physical device as a whole. If the disk
is divided into several sections, for each of these sections can be created
separate logical device. Logic devices can be created on the basis of several
sections, these sections do not necessarily have the same physical device.
Combining multiple partitions in a single logical device can be done in
different ways and have different goals, the main of which are: the overall
increase in logical partition, increased productivity and reliability. Examples
of the organization work together more disk partitions are called RAID arrays,
details of which will be described below. At different logical devices of the
same physical disk file systems can be of different types. Fig. 7.10 shows a
sample disc, broken into three sections, in which the two file system NTFS (sections
C and E) and one FAT file system (section D). All sections of the disc are the
same block size, for a disc of low-level formatting. However, the high level
formatting in the different sections of the same disc submitted by different
logical devices can be installed file systems, which define the different
clusters sizes. The operating system can support different statuses sections,
particularly noting the sections that can be used to boot the operating system
modules, and the sections in which you can install only the applications and
store data files. One disk marked as a downloadable (or active). It is from this
section read boot the operating system. The physical organization and address
file An important component of the physical file system is the physical
organization of the file, it has a way of a file on the disk. The main criteria
for the effectiveness of the physical files are: speed data access; targeted
information file; The degree of fragmentation of disk space; possible file
size. Continuous-the easiest option of physical Organization (Fig. 7.11, a), in
which a file is consistency disk clusters, forming a continuous plot disk memory.
The main advantage of this method is the high speed access, as well as the cost
of finding and reading the file clusters minimal. Also targeted minimal amount
of information-enough room to store only the first cluster and file. This
physical organization possible file size limits. However, this option has
significant drawbacks, which make it applicable in practice, despite its logical
simplicity. With closer examination, it appears to realize this scheme is not
easy. Indeed, what size should be continuous area allocated file, if the file
with each modification may increase its size? An even more serious problem is
fragmentation. A short time later, after a file system as a result of numerous
operations and the removal of files disk space inevitably becomes a "patchwork",
including a large number of free small. As always with fragmentation, the total
amount of free memory can be quite large, and choose where to place the file is
not possible. Therefore, in practice, using methods, in which a file is placed
in a more in general areas adjacent disk.
|