Files (space)
Files (space)
Copyright(c) Management Analytics, 1995 - All Rights Reserved
Copyright(c), 1990, 1995 Dr. Frederick B. Cohen - All Rights Reserved
Files come in four types (Regular,
Character-Special, Block-Special, and Directory)
and are used to model storage and peripheral devices. The file
types are used as follows:
- Regular files are the normal sorts of storage
files we tend to think of when we think about computers. They
are accessible either sequentially or randomly; they can be created,
destroyed, and changed; they store what you put in them and retrieve it
at your request.
- Character-Special files are logical units used to
represent sequential device control programs. They are sequential in
that you send them sequences of symbols that are processed into output
as they arrive, and they return sequences of symbols arriving from their
inputs. They are device control programs in that, even though you treat
them as files from an input and output standpoint, they actually
act as programs that transform input and output requests into actions.
They are character files in that they handle information a
character at a time.
- Block-Special files are like character special
files except that they handle information in blocks of bytes
instead of single bytes. This makes them particularly suitable for DMA
devices.
- Directory files are actually just like regular
files except that they store lists of file names and their
inode numbers. An inode number is an integer associated
with a system structure that holds system information about a
file, and is designated by the system upon file creation.
A few examples may help to understand how these types of
files are used. Memory, for example, is modeled by several
Character-Special files which allow user memory,
kernel memory, or physical memory to be accessed. Physical disks are
represented by Block-Special files, while the files
stored on those physical disks are represented by Regular
files, and grouped under Directory files. Most
sequential peripherals, like terminals, tape drives, and parallel ports,
are represented as Character-Special files. DMA devices
like network interfaces and external disks, are typically represented as
Block-Special files.
The Directory files are normally used to form a tree
structured logical file-structure, with the ``/'' (root)
directory as the root of the file tree.