Home

Pathnames

Pathnames are strings that designate the location of a resource within a hierarchical namespace, most commonly a filesystem. They can be absolute, which specifies a location from the root, or relative, describing a location from the current working directory. Pathnames are made up of components separated by a delimiter: typically a forward slash on POSIX systems or a backslash on Windows, though many environments accept forward slashes in general.

A typical pathname contains a root indicator (such as / on POSIX, or a drive letter like C:\

Different platforms have different conventions. POSIX pathnames use / as the separator and treat file names as

Pathnames are subject to resolution rules. Some components may be symbolic or junction links that redirect

In programming, pathnames are manipulated by library functions that join, normalize, split, and resolve components, with

on
Windows),
followed
by
one
or
more
directory
names
and,
finally,
a
resource
name
such
as
a
file.
Special
components
may
appear:
.
denotes
the
current
directory,
and
..
denotes
the
parent
directory;
consecutive
separators
are
usually
treated
as
a
single
separator.
case-sensitive;
Windows
pathnames
can
use
\
or
/
as
the
separator
and
often
are
case-insensitive.
URL
paths
are
a
related
concept
where
the
portion
after
the
domain
describes
nested
resources,
separated
by
/.
to
other
locations,
requiring
normalization
to
obtain
a
canonical
path.
Absolute
vs
relative
paths,
symbolic
links,
and
mount
points
can
affect
what
a
given
pathname
refers
to.
care
to
avoid
security
risks
such
as
path
traversal
vulnerabilities
when
accepting
user
input.