Files and Directories

File: set of data on a storage device (e.g. a hard disk) that belong together and are identified by a name.

$\triangleright$
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.

$\triangleright$
Directories help to organize a large number of files, e.g. directories for different users or for special applications.

$\triangleright$
Since a directory is a (special) file, a directory can contain other (sub)directories.

$\bullet$
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.

809

$\bullet$
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.

$\bullet$
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.

$\triangleright$
The subdirectories in the path are separated by \ in DOS/Windows, in UNIX by / .

$\diamond$
UNIX: /home/rztpj/myTexts/course.tex; root directory: /
DOS: \dos\command.com; root directory: \

$\bullet$
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.

$\diamond$
absolute path: \user\mary\letter.txt
relative to current directory \user\joe: ..\mary\letter.txt

$\triangleright$
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.

919

$\triangleright$
In UNIX there is a unique directory tree, which encompasses all devices. The subsystems are connected to an arbitrary position in the tree (``mounted'').

927

previous    contents     next

Peter Junglas 8.3.2000