How can I get the platform-specific path separator (not directory separator) in C++, i.e. the separator that is needed to combine multiple paths in a list (e.g. PATH environment variable).
Under Linux, this would be :, under Windows ;.
In other words, I am looking for the C++-equivalent of Python's os.pathsep, Java's path.separator or PHP's PATH_SEPARATOR.
If Boost provides such a function that would be fine, as we are using it in our projects anyway. If not, I guess any other solution would be good.
All I could find (here and elsewhere) were either just ways to retrieve the directory separator (i.e. / vs. \) or related to other languages than C++.
#ifdef _WIN32 const std::string os_pathsep(";") #else const std::string os_pathsep(":") #endif/or `\`).