Path (computing)

A path name (also path ) is a string that identifies a file, a directory, or according to other resources on a computer system, such as device files on Unix platform.

In contrast to the file name of a file or directory that represents only one path name component, allows a path for example, opening or deleting a file.

Construction

Depending on the operating system, there is a path name of the following elements:

  • A drive or volume label
  • A list of directories or ( sub) directories
  • A file name

Nearly all modern operating systems are designed, data (and thus files and directories) to manage multiple physical disks. When addressing the data different ways are:

On Windows, for example, a path is preceded by a letter that identifies the appropriate drive where the volume is.

Example of a file name on Windows: C: \ private \ test data \ beispiel.txt

Here, "C" is the drive on which the file is ( = 1 hard drive). At the top level of the filesystem on this disk there is a directory "private", including one named " testdata " and there is " beispiel.txt " to find the file.

On Unix and Unix derivatives (eg Linux, NetBSD ) there is a " root " (root directory), is addressed by the directory- oriented starting pure. The root directory is usually on the disk from which the system startup. The operating system supports the involvement of additional disks available then by managing the so-called "mount points".

Example of a file name on Unix: / home / user / example file

There is a directory in the root directory "home ", including "user " and there is " example file ".

From the Unix path alone is not clear on which physical disk " for file " is.

Absolute and relative pathnames

From the operating system perspective, a path name is only unambiguous when it is given in full as described above. To simplify operation and programming, it is possible for most systems, to work with so-called relative path name. This individual components of a path name can be omitted, such as the drive specification or part of the preceding directory listing.

Examples of relative paths:

  • Windows: subdir \ test file or \ autoexec.bat or .. \ data \ tabelle1.xls.
  • Unix: .. / lib / libXYZ.a

As a reference for relative path names the current drive (Windows / Apple) as well as the current directory is managed by the operating system for each running program. Incomplete, "relative" paths are then interpreted on the basis of the current values.

Example ( Windows):

  • Current drive is C:
  • Current directory is \ private \ texte

Access to the relative path .. \ data \ tabelle1.xls will be starting from C: \ private \ texte interpreted as C: \ private \ texte \ .. \ data \ tabelle1.xls. The string " .. " means a change to the parent directory. In order for the resolution, simplified path name is then C: \ private \ data \ tabelle1.xls. Similarly, one can in this example \ text1.txt the path C:. \ Private \ texte \ text1.txt visit, as always stands for the current directory ". ".

Instead the drive letter it has also become common today specify the name in UNC format and specify the server name instead of the drive letter in Windows systems. See also Uniform Naming Convention

Default path

Depending on the nature and purpose of the file to be saved their storage by default at certain points within hierarchically structured directory trees. See, for example initialization file # location.

  • File Management
31042
de