30 Input/output library [input.output]

30.10 File systems [filesystems]

30.10.4 Terms and definitions [fs.definitions]

30.10.4.1 absolute path [fs.def.absolute.path]

A path that unambiguously identifies the location of a file without reference to an additional starting location.
The elements of a path that determine if it is absolute are operating system dependent.

30.10.4.2 directory [fs.def.directory]

A file within a file system that acts as a container of directory entries that contain information about other files, possibly including other directory files.

30.10.4.3 file [fs.def.file]

An object within a file system that holds user or system data.
Files can be written to, or read from, or both.
A file has certain attributes, including type.
File types include regular files and directories.
Other types of files, such as symbolic links ([fs.def.symlink]), may be supported by the implementation.

30.10.4.4 file system [fs.def.filesystem]

A collection of files and their attributes.

30.10.4.5 file system race [fs.def.race]

The condition that occurs when multiple threads, processes, or computers interleave access and modification of the same object within a file system.

30.10.4.6 filename [fs.def.filename]

The name of a file.
Filenames dot and dot-dot, consisting solely of one and two period characters respectively, have special meaning.
The following characteristics of filenames are operating system dependent:
  • The permitted characters.
    [Example
    :
    Some operating systems prohibit the ASCII control characters (0x00 – 0x1F) in filenames.
    end example
    ]
  • The maximum permitted length.
  • Filenames that are not permitted.
  • Filenames that have special meaning.
  • Case awareness and sensitivity during path resolution.
  • Special rules that may apply to file types other than regular files, such as directories.

30.10.4.9 native encoding [fs.def.native.encode]

For narrow character strings, the operating system dependent current encoding for pathnames ([fs.def.pathname]).
For wide character strings, the implementation-defined execution wide-character set encoding ([lex.charset]).

30.10.4.10 native pathname format [fs.def.native]

The operating system dependent pathname format accepted by the host operating system.

30.10.4.11 normal form [fs.def.normal.form]

A path in normal form is said to be normalized.
The process of obtaining a normalized path from a path that is not in normal form is called normalization.
Normalization of a generic format pathname means:
  1. If the path is empty, stop.
  2. Replace each slash character in the root-name with a preferred-separator.
  3. [Note
    :
    The generic pathname grammar ([fs.path.generic]) defines directory-separator as one or more slashes and preferred-separators.
    end note
    ]
  4. Remove each dot filename and any immediately following directory-separator.
  5. As long as any appear, remove a non-dot-dot filename immediately followed by a directory-separator and a dot-dot filename, along with any immediately following directory-separator.
  6. If there is a root-directory, remove all dot-dot filenames and any directory-separators immediately following them.
    [Note
    :
    These dot-dot filenames attempt to refer to nonexistent parent directories.
    end note
    ]
  7. If the last filename is dot-dot, remove any trailing directory-separator.
  8. If the path is empty, add a dot.

30.10.4.12 operating system dependent behavior [fs.def.osdep]

Behavior that is dependent upon the behavior and characteristics of an operating system.

30.10.4.13 parent directory [fs.def.parent]

⟨of a directory⟩ the directory that both contains a directory entry for the given directory and is represented by the filename dot-dot in the given directory.

30.10.4.14 parent directory [fs.def.parent.other]

⟨of other types of files⟩ a directory containing a directory entry for the file under discussion.

30.10.4.15 path [fs.def.path]

A sequence of elements that identify the location of a file within a filesystem.
The elements are the root-name, root-directory, and an optional sequence of filenames.
The maximum number of elements in the sequence is operating system dependent.

30.10.4.16 pathname [fs.def.pathname]

A character string that represents the name of a path.
Pathnames are formatted according to the generic pathname format grammar ([fs.path.generic]) or an operating system dependent native pathname format.

30.10.4.17 pathname resolution [fs.def.pathres]

Pathname resolution is the operating system dependent mechanism for resolving a pathname to a particular file in a file hierarchy.
There may be multiple pathnames that resolve to the same file.
[Example
:
POSIX specifies the mechanism in section 4.
11, Pathname resolution.
end example
]

30.10.4.18 relative path [fs.def.rel.path]

A path that is not absolute, and as such, only unambiguously identifies the location of a file when resolved ([fs.def.pathres]) relative to an implied starting location.
The elements of a path that determine if it is relative are operating system dependent.
[Note
:
Pathnames “.
” and “.
” are relative paths.
end note
]