File: set of data on a storage device (e.g. a hard disk) that
belong together and are identified by a name.
- A file on a disk is usually distributed as a set of blocks. Additional
information like number and position of the blocks, creation time or owner,
are stored in a special area.
Directory: special kind of file that contains a list of other files
that build a logical unit.
- Directories help to organize a large number of files, e.g. directories for
different users or for special applications.
- Since a directory is a (special) file, a directory can contain other
- The partitioning of files into directories and subdirectories defines a
logical tree structure, the directory tree. The branches of this
tree are the directories, the leaves are the (regular) files.
- Some special directories:
- root directory: the starting point or top of the directory
tree. Only directory that is not contained in another one.
- parent directory of a given directory: the directory immediately
above the given one.
- home directory: in a multi-user environment the directory that
contains the files of a given user.
- Every file can be identified uniquely by giving the series of subdirectories
it lies in, starting with the root directory. This list is called
path or absolute path of the file.
- The subdirectories in the path are separated by \ in DOS/Windows, in
UNIX by / .
- UNIX: /home/rztpj/myTexts/course.tex; root directory: /
DOS: \dos\command.com; root directory: \
- When working in a DOS or shell window, the system stores a special
directory,the current directory, where it looks for files, if the
total (absolute) path name is missing. Files in the parent directory can be
adressed by ../filename. In this way one can reach every file with a
relative path, which is valid relativ to the current directory.
- absolute path: \user\mary\letter.txt
relative to current directory \user\joe: ..\mary\letter.txt
- In Windows there exists a complete directory tree for each storage device
(disks, floppies, CD-ROM). A device is given by a single letter, which
precludes an absolute path, as in C:\Windows\system.ini.
- In UNIX there is a unique directory tree, which encompasses all devices. The
subsystems are connected to an arbitrary position in the tree (``mounted'').
Peter Junglas 8.3.2000