Standard Module posixpath

posixpath This module implements some useful functions on POSIX pathnames.


\begin{funcdesc}{basename}{p}
Return the base name of pathname
\var{p}.
This is ...
...ond half of the pair returned by
\code{posixpath.split(\var{p})}.
\end{funcdesc}


\begin{funcdesc}{commonprefix}{list}
Return the longest string that is a prefix ...
...st}.
If
\var{list}
is empty, return the empty string (\code{''}).
\end{funcdesc}


\begin{funcdesc}{exists}{p}
Return true if
\var{p}
refers to an existing path.
\end{funcdesc}


\begin{funcdesc}{expanduser}{p}
Return the argument with an initial component of...
...path does not begin with a tilde, the path is returned unchanged.
\end{funcdesc}


\begin{funcdesc}{expandvars}{p}
Return the argument with environment variables e...
...ames and references to non-existing variables are left
unchanged.
\end{funcdesc}


\begin{funcdesc}{isabs}{p}
Return true if \var{p} is an absolute pathname (begins with a slash).
\end{funcdesc}


\begin{funcdesc}{isfile}{p}
Return true if \var{p} is an existing regular file. ...
...nks, so both islink() and isfile() can be true for the same
path.
\end{funcdesc}


\begin{funcdesc}{isdir}{p}
Return true if \var{p} is an existing directory. This...
...inks, so both islink() and isdir() can be true for the same
path.
\end{funcdesc}


\begin{funcdesc}{islink}{p}
Return true if
\var{p}
refers to a directory entry t...
... symbolic link.
Always false if symbolic links are not supported.
\end{funcdesc}


\begin{funcdesc}{ismount}{p}
Return true if \var{p} is a mount point. (This curr...
...ice --- is this test correct for all \UNIX{} and POSIX variants?)
\end{funcdesc}


\begin{funcdesc}{join}{p\, q}
Join the paths
\var{p}
and
\var{q} intelligently:
...
...(\code{'/'}) inserted unless
\var{p}
is empty or ends in a slash.
\end{funcdesc}


\begin{funcdesc}{normcase}{p}
Normalize the case of a pathname. This returns the...
...lar function in \code{macpath} converts upper case to
lower case.
\end{funcdesc}


\begin{funcdesc}{samefile}{p\, q}
Return true if both pathname arguments refer t...
...ber).
Raise an exception if a stat call on either pathname fails.
\end{funcdesc}


\begin{funcdesc}{split}{p}
Split the pathname \var{p} in a pair \code{(\var{head...
...ains no slash, \var{head} is
empty and \var{tail} equals \var{p}.
\end{funcdesc}


\begin{funcdesc}{splitext}{p}
Split the pathname \var{p} in a pair \code{(\var{r...
...tains no periods,
and \var{ext} is empty or begins with a period.
\end{funcdesc}


\begin{funcdesc}{walk}{p\, visit\, arg}
Calls the function \var{visit} with argu...
...must be modified in place, using
\code{del} or slice assignment.)
\end{funcdesc}