\hypertarget{os__path_8h}{\section{opal/util/os\+\_\+path.h File Reference}
\label{os__path_8h}\index{opal/util/os\+\_\+path.\+h@{opal/util/os\+\_\+path.\+h}}
}


Creates an operating system-\/acceptable path name.  


{\ttfamily \#include \char`\"{}opal\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include $<$stdio.\+h$>$}\\*
{\ttfamily \#include $<$stdarg.\+h$>$}\\*
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{os__path_8h_acf26195c55c9a29e12156be1a410efb4}{opal\+\_\+make\+\_\+filename\+\_\+os\+\_\+friendly}(P\+A\+T\+H)~(P\+A\+T\+H)
\begin{DoxyCompactList}\small\item\em Convert the path to be O\+S friendly. \end{DoxyCompactList}\end{DoxyCompactItemize}
\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{os__path_8h_ab1d0bb164479dc30160e3451010e4839}{opal\+\_\+os\+\_\+path} (bool relative,...) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+malloc\+\_\+\+\_\+ \+\_\+\+\_\+opal\+\_\+attribute\+\_\+sentinel\+\_\+\+\_\+ \+\_\+\+\_\+opal\+\_\+attribute\+\_\+warn\+\_\+unused\+\_\+result\+\_\+\+\_\+
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Creates an operating system-\/acceptable path name. 

The \hyperlink{os__path_8h_ab1d0bb164479dc30160e3451010e4839}{opal\+\_\+os\+\_\+path()} function takes a variable number of string arguments and concatenates them into a path name using the path separator character appropriate to the local operating system. N\+O\+T\+E\+: the string returned by this function has been malloc'd -\/ thus, the user is responsible for free'ing the memory used by the string.

C\+R\+I\+T\+I\+C\+A\+L N\+O\+T\+E\+: The input variable list M\+U\+S\+T be terminated by a N\+U\+L\+L value. Failure to do this will cause the program to suffer a catastrophic failure -\/ usually a segmentation violation or bus error.

The function calls orte\+\_\+sys\+\_\+info() to ensure that the path separator character has been identified. If that value cannot be identified for some reason, the function will return a N\+U\+L\+L value. Likewise, specifying a path name that exceeds the maximum allowable path name length on the local system will result in the return of a N\+U\+L\+L value. 

\subsection{Macro Definition Documentation}
\hypertarget{os__path_8h_acf26195c55c9a29e12156be1a410efb4}{\index{os\+\_\+path.\+h@{os\+\_\+path.\+h}!opal\+\_\+make\+\_\+filename\+\_\+os\+\_\+friendly@{opal\+\_\+make\+\_\+filename\+\_\+os\+\_\+friendly}}
\index{opal\+\_\+make\+\_\+filename\+\_\+os\+\_\+friendly@{opal\+\_\+make\+\_\+filename\+\_\+os\+\_\+friendly}!os\+\_\+path.\+h@{os\+\_\+path.\+h}}
\subsubsection[{opal\+\_\+make\+\_\+filename\+\_\+os\+\_\+friendly}]{\setlength{\rightskip}{0pt plus 5cm}\#define opal\+\_\+make\+\_\+filename\+\_\+os\+\_\+friendly(
\begin{DoxyParamCaption}
\item[{}]{P\+A\+T\+H}
\end{DoxyParamCaption}
)~(P\+A\+T\+H)}}\label{os__path_8h_acf26195c55c9a29e12156be1a410efb4}


Convert the path to be O\+S friendly. 

On U\+N\+I\+X this function will be empty, when on Windows it will convert all '/' to '\textbackslash{}' and eventually remove the '/cygdrive/' from the beginning of the path (if the configure was runned under Cygwin). 

Referenced by opal\+\_\+dirname(), and opal\+\_\+os\+\_\+path().



\subsection{Function Documentation}
\hypertarget{os__path_8h_ab1d0bb164479dc30160e3451010e4839}{\index{os\+\_\+path.\+h@{os\+\_\+path.\+h}!opal\+\_\+os\+\_\+path@{opal\+\_\+os\+\_\+path}}
\index{opal\+\_\+os\+\_\+path@{opal\+\_\+os\+\_\+path}!os\+\_\+path.\+h@{os\+\_\+path.\+h}}
\subsubsection[{opal\+\_\+os\+\_\+path}]{\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\+\_\+os\+\_\+path (
\begin{DoxyParamCaption}
\item[{bool}]{relative, }
\item[{}]{...}
\end{DoxyParamCaption}
)}}\label{os__path_8h_ab1d0bb164479dc30160e3451010e4839}

\begin{DoxyParams}{Parameters}
{\em relative} & A boolean that specifies if the path name is to be constructed relative to the current directory or as an absolute path. If no path elements are included in the function call, then the function returns \char`\"{}.\char`\"{} for a relative path name and \char`\"{}$<$path separator char$>$\char`\"{} -\/ the top of the directory tree -\/ for an absolute path name. \\
\hline
{\em elem1,elem2,...} & A variable number of (char $\ast$)path\+\_\+elements can be provided to the function, terminated by a N\+U\+L\+L value. These elements will be concatenated, each separated by the path separator character, into a path name and returned. \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em path\+\_\+name} & A pointer to a fully qualified path name composed of the provided path elements, separated by the path separator character appropriate to the local operating system. The path\+\_\+name string has been malloc'd and therefore the user is responsible for free'ing the field. \\
\hline
\end{DoxyRetVals}


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



Referenced by opal\+\_\+os\+\_\+dirpath\+\_\+destroy(), orte\+\_\+ess\+\_\+base\+\_\+orted\+\_\+setup(), orte\+\_\+plm\+\_\+submit\+\_\+launch(), orte\+\_\+session\+\_\+dir\+\_\+cleanup(), and orte\+\_\+session\+\_\+dir\+\_\+finalize().

