\hypertarget{group__path}{
\section{path: Filename manipulation functions}
\label{group__path}\index{path: Filename manipulation functions@{path: Filename manipulation functions}}
}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{group__path_g03cca24a2a9859b58cd517f5231c46e7}{PATH\_\-MATCH\_\-DOTFILES}~1
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{group__path_g3824d65862af5b0b924b5fe04f477b11}{path\_\-merge} (\hyperlink{structstr}{str} $\ast$path, const char $\ast$start)
\item 
int \hyperlink{group__path_g008d97b69772c505673b77c8bd6d2d02}{fnmatch} (const char $\ast$filename, const char $\ast$pattern, unsigned options)
\item 
int \hyperlink{group__path_g9d3d2b90a484ecb5e7d23b95c5b1a7ea}{has\_\-magic} (const char $\ast$s)
\item 
int \hyperlink{group__path_g3a22e9e172a01e5b3480988f3a85f6ba}{path\_\-match} (const char $\ast$pattern, \hyperlink{structstr}{str} $\ast$result, unsigned options)
\item 
int \hyperlink{group__path_g773978c103a04f5d151085cde2b4a019}{path\_\-contains} (const char $\ast$path, const char $\ast$part)
\item 
int \hyperlink{group__path_g7531dc468913cc8df67bf4b0b5595c5a}{path\_\-mktemp} (const char $\ast$prefix, \hyperlink{structstr}{str} $\ast$filename)
\item 
int \hyperlink{group__path_g6e1b0edb51abca88c8cfa307342bc8ac}{path\_\-mkdirs} (const char $\ast$path, unsigned mode)
\end{CompactItemize}


\subsection{Define Documentation}
\hypertarget{group__path_g03cca24a2a9859b58cd517f5231c46e7}{
\index{path@{path}!PATH\_\-MATCH\_\-DOTFILES@{PATH\_\-MATCH\_\-DOTFILES}}
\index{PATH\_\-MATCH\_\-DOTFILES@{PATH\_\-MATCH\_\-DOTFILES}!path@{path}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define PATH\_\-MATCH\_\-DOTFILES~1}}
\label{group__path_g03cca24a2a9859b58cd517f5231c46e7}


Make path\_\-match include files starting with dots. 

\subsection{Function Documentation}
\hypertarget{group__path_g008d97b69772c505673b77c8bd6d2d02}{
\index{path@{path}!fnmatch@{fnmatch}}
\index{fnmatch@{fnmatch}!path@{path}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int fnmatch (const char $\ast$ {\em filename}, const char $\ast$ {\em pattern}, unsigned {\em options})}}
\label{group__path_g008d97b69772c505673b77c8bd6d2d02}


Matches a path using glob patterns. \hypertarget{group__path_g9d3d2b90a484ecb5e7d23b95c5b1a7ea}{
\index{path@{path}!has\_\-magic@{has\_\-magic}}
\index{has\_\-magic@{has\_\-magic}!path@{path}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int has\_\-magic (const char $\ast$ {\em s})}}
\label{group__path_g9d3d2b90a484ecb5e7d23b95c5b1a7ea}


Does the string have glob characters in it.

Returns true if the given string contains at least one instance of either {\tt $\ast$}, {\tt ?}, or {\tt \mbox{[}}. \hypertarget{group__path_g773978c103a04f5d151085cde2b4a019}{
\index{path@{path}!path\_\-contains@{path\_\-contains}}
\index{path\_\-contains@{path\_\-contains}!path@{path}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int path\_\-contains (const char $\ast$ {\em path}, const char $\ast$ {\em part})}}
\label{group__path_g773978c103a04f5d151085cde2b4a019}


Test if a path contains a component.

Returns true if the {\tt path} contains {\tt part} either at the start followed by a slash, at the end preceded by a slash, or elsewhere with a slash on either side. \hypertarget{group__path_g3a22e9e172a01e5b3480988f3a85f6ba}{
\index{path@{path}!path\_\-match@{path\_\-match}}
\index{path\_\-match@{path\_\-match}!path@{path}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int path\_\-match (const char $\ast$ {\em pattern}, {\bf str} $\ast$ {\em result}, unsigned {\em options})}}
\label{group__path_g3a22e9e172a01e5b3480988f3a85f6ba}


Matches the pattern against existing files.

This function produces a list of existing files in {\tt result} (in the current directory) that match the given pattern. If {\tt options} has {\tt PATH\_\-MATCH\_\-DOTFILES} set, the result may contain paths starting with \char`\"{}.\char`\"{}. \hypertarget{group__path_g3824d65862af5b0b924b5fe04f477b11}{
\index{path@{path}!path\_\-merge@{path\_\-merge}}
\index{path\_\-merge@{path\_\-merge}!path@{path}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int path\_\-merge ({\bf str} $\ast$ {\em path}, const char $\ast$ {\em start})}}
\label{group__path_g3824d65862af5b0b924b5fe04f477b11}


Merge two paths together.

This function takes a starting path, and merges the second path into it. If the second path starts with a \char`\"{}/\char`\"{}, it replaces the existing path completely. If the second path contains any \char`\"{}..\char`\"{} components, the preceding directory component in the current path (if any) is removed. All \char`\"{}.\char`\"{} components are removed.

The effects of this function are equivalent to changing directory to the first path and then using the second one. \hypertarget{group__path_g6e1b0edb51abca88c8cfa307342bc8ac}{
\index{path@{path}!path\_\-mkdirs@{path\_\-mkdirs}}
\index{path\_\-mkdirs@{path\_\-mkdirs}!path@{path}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int path\_\-mkdirs (const char $\ast$ {\em path}, unsigned {\em mode})}}
\label{group__path_g6e1b0edb51abca88c8cfa307342bc8ac}


Create a directory, optionally creating any parent directories.

This function creates the named directory using {\tt mkdir}. If any of the parent directories of the specified path do not exist, they are created as well (with the same mode).

\begin{Desc}
\item[Note:]Unlike the \char`\"{}$<$tt$>$mkdir -p$<$/tt$>$\char`\"{} command, this function will result in an error if the path already exists. \end{Desc}
\hypertarget{group__path_g7531dc468913cc8df67bf4b0b5595c5a}{
\index{path@{path}!path\_\-mktemp@{path\_\-mktemp}}
\index{path\_\-mktemp@{path\_\-mktemp}!path@{path}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int path\_\-mktemp (const char $\ast$ {\em prefix}, {\bf str} $\ast$ {\em filename})}}
\label{group__path_g7531dc468913cc8df67bf4b0b5595c5a}


Create a temporary file.

This function creates a temporary file by adding an difficult-to-predict suffix (using the PID and microsecond timestamp) to the given prefix. If this filename does not exist, it is opened in read/write mode. 