FUNCTION os_separator, path=path, dir=dir ;+ ; NAME: ; os_separator ; PURPOSE: ; Defines a couple of platform-dependent characters ; CATEGORY: ; environment ; CALLING SEQUENCE: ; char = os_separator( [/dir, /path] ) ; OPTIONAL INPUT PARAMETERS: ; /dir if set then the directory terminator is returned ; /path if set then the path separator is returned ; OUTPUTS: ; char scalar, type: char ; requested character (see above) ; /dir set : ] on vms, / on unix, \ on windows ; /path set: , on windows and vms, space on unix and mac ; INCLUDE: @compile_opt.pro ; On error, return to caller ; PROCEDURE: ; Checks !version.os_family to select platform. ; MODIFICATION HISTORY: ; JUN-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- InitVar, path, /key InitVar, dir , /key CASE 1 OF dir : char = (['/','\',']',':'])[(where(strlowcase(!version.os_family) eq ['unix','windows','vms','macos']))[0]] path: char = ([' ',',',',',' '])[(where(strlowcase(!version.os_family) eq ['unix','windows','vms','macos']))[0]] ELSE: char = '' ENDCASE RETURN, char & END