I have developed a cross-platform LabVIEW based application. It will run on Mac OSX, Linux and Windows. It needs to reliably detect the operating system it is running on to use the right delimiters for pathnames (I generate file names / folders based on other front panel input).
I have been using a kludge of sorts to do this. I use a VI server reference and use the OS Name property node, wire it into a search / replace string VI and count the number of times a substring "Windows" is replaced. If the number of replacements is greater than 0, I know it is Windows. Else, I test for Linux. Do the same thing. Then if it is neither Windows nor Linux, I assume it is Mac OSX.
This kludge which worked for the VIs running on Mac OSX and Windows, does not seem to work for the application compiled on Windows LabVIEW PDS (the absence of a gcc style cross-compiler for LabVIEW is a sort of a raw subject for me right now since NI forces developers to pick an OS by creating a needless barrier for cross-platform compilation, but we will not go into that). There are no other points in my code which detect the right delimiter to use (":" for Mac HFS, "/" for Linux filesystems and "\" for Windows FAT32 and NTFS).
I imagine that there are folks here who have tried to something of the sort. Is there a Detect OS and Find the right Delimiter.vi that someone may have and want to share ?