\hypertarget{basename_8h}{\section{opal/util/basename.h File Reference}
\label{basename_8h}\index{opal/util/basename.\+h@{opal/util/basename.\+h}}
}


Returns an O\+S-\/independant basename() of a given filename.  


{\ttfamily \#include \char`\"{}opal\+\_\+config.\+h\char`\"{}}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char $\ast$ \hyperlink{basename_8h_aab4b541afc06a0a87c12faa2f51700b8}{opal\+\_\+basename} (const char $\ast$filename) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+malloc\+\_\+\+\_\+ \+\_\+\+\_\+opal\+\_\+attribute\+\_\+warn\+\_\+unused\+\_\+result\+\_\+\+\_\+
\begin{DoxyCompactList}\small\item\em Return the basename of a filename. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char $\ast$ \hyperlink{basename_8h_a3c4521f5227106c7d1aea05598142fd4}{opal\+\_\+dirname} (const char $\ast$filename) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+malloc\+\_\+\+\_\+ \+\_\+\+\_\+opal\+\_\+attribute\+\_\+warn\+\_\+unused\+\_\+result\+\_\+\+\_\+
\begin{DoxyCompactList}\small\item\em Return the dirname of a filename. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Returns an O\+S-\/independant basename() of a given filename. 



\subsection{Function Documentation}
\hypertarget{basename_8h_aab4b541afc06a0a87c12faa2f51700b8}{\index{basename.\+h@{basename.\+h}!opal\+\_\+basename@{opal\+\_\+basename}}
\index{opal\+\_\+basename@{opal\+\_\+basename}!basename.\+h@{basename.\+h}}
\subsubsection[{opal\+\_\+basename}]{\setlength{\rightskip}{0pt plus 5cm}B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char$\ast$ opal\+\_\+basename (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{filename}
\end{DoxyParamCaption}
)}}\label{basename_8h_aab4b541afc06a0a87c12faa2f51700b8}


Return the basename of a filename. 


\begin{DoxyParams}{Parameters}
{\em filename} & The filename to examine\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A string containing the basename, or N\+U\+L\+L if there is an error
\end{DoxyReturn}
The contents of the {\itshape filename} parameter are unchanged. This function returns a new string containing the basename of the filename (which must be eventually freed by the caller), or N\+U\+L\+L if there is an error. Trailing \char`\"{}/\char`\"{} characters in the filename do not count, unless it is in the only part of the filename (e.\+g., \char`\"{}/\char`\"{} or \char`\"{}\+C\+:\textbackslash{}\char`\"{}).

This function will do the Right Things on P\+O\+S\+I\+X and Windows-\/based operating systems. For example\+:

foo.\+txt returns \char`\"{}foo.\+txt\char`\"{}

/foo/bar/baz returns \char`\"{}baz\char`\"{}

/yow.c returns \char`\"{}yow.\+c\char`\"{}

/ returns \char`\"{}/\char`\"{}

C\+: returns \char`\"{}baz\char`\"{}

D\+:foo.\+txt returns \char`\"{}foo.\+txt\char`\"{}

E\+:.c returns \char`\"{}yow.\+c\char`\"{}

F\+: returns \char`\"{}\+F\+:\char`\"{}

G\+:\textbackslash{} returns \char`\"{}\+G\+:\char`\"{}

The caller is responsible for freeing the returned string. 

Referenced by orte\+\_\+plm\+\_\+submit\+\_\+launch().

\hypertarget{basename_8h_a3c4521f5227106c7d1aea05598142fd4}{\index{basename.\+h@{basename.\+h}!opal\+\_\+dirname@{opal\+\_\+dirname}}
\index{opal\+\_\+dirname@{opal\+\_\+dirname}!basename.\+h@{basename.\+h}}
\subsubsection[{opal\+\_\+dirname}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char$\ast$ opal\+\_\+dirname (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{filename}
\end{DoxyParamCaption}
)}}\label{basename_8h_a3c4521f5227106c7d1aea05598142fd4}


Return the dirname of a filename. 


\begin{DoxyParams}{Parameters}
{\em filename} & The filename to examine\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A string containing the dirname, or N\+U\+L\+L if there is an error
\end{DoxyReturn}
The contents of the {\itshape filename} parameter are unchanged. This function returns a new string containing the dirname of the filename (which must be eventually freed by the caller), or N\+U\+L\+L if there is an error. Trailing \char`\"{}/\char`\"{} characters in the filename do not count, unless it is in the only part of the filename (e.\+g., \char`\"{}/\char`\"{} or \char`\"{}\+C\+:\textbackslash{}\char`\"{}).

This function will do the Right Things on P\+O\+S\+I\+X and Windows-\/based operating systems. For example\+:

foo.\+txt returns \char`\"{}foo.\+txt\char`\"{}

/foo/bar/baz returns \char`\"{}/foo/bar\char`\"{}

/yow.c returns \char`\"{}/\char`\"{}

/ returns \char`\"{}\char`\"{}

C\+: returns \char`\"{}\+C\+:\textbackslash{}foo\textbackslash{}bar\char`\"{}

D\+:foo.\+txt returns \char`\"{}\+D\+:\char`\"{}

E\+:.c returns \char`\"{}\+E\+:\char`\"{}

F\+: returns \char`\"{}\char`\"{}

G\+:\textbackslash{} returns \char`\"{}\char`\"{}

The caller is responsible for freeing the returned string. 

References opal\+\_\+make\+\_\+filename\+\_\+os\+\_\+friendly.



Referenced by orte\+\_\+iof\+\_\+base\+\_\+open(), and orte\+\_\+session\+\_\+dir().

