idlastro / Miscellaneous (Non-Astronomy) Procedures: CONCAT_DIR

[Source code]

NAME
CONCAT_DIR()
PURPOSE
To concatenate directory and file names for current OS.
EXPLANATION
The given file name is appended to the given directory name with the 
format appropriate to the current operating system.
CALLING SEQUENCE
result = concat_dir( directory, file) 
INPUTS
directory  - the directory path (string)
file       - the basic file name and extension (string)
                            can be an array of filenames.
OUTPUTS
The function returns the concatenated string.  If the file input
is a string array then the output will be a string array also.
EXAMPLES
IDL> pixfile = concat_dir('$DIR_GIS_MODEL','pixels.dat')
IDL> file = ['f1.dat','f2.dat','f3.dat']
IDL> dir = '$DIR_NIS_CAL'
IDL> 
RESTRICTIONS
The version of CONCAT_DIR available at 
http://sohowww.nascom.nasa.gov/solarsoft/gen/idl/system/concat_dir.pro
includes (mostly) additional VMS-specific keywords.
CATEGORY
Utilities, Strings
REVISION HISTORY
Prev Hist. : Yohkoh routine by M. Morrison
Written     : CDS version by C D Pike, RAL, 19/3/93
Version     : Version 1  19/3/93
Documentation modified Nov-94   W. Landsman 
Add V4.0 support for Windows    W. Landsman   Aug 95
Converted to IDL V5.0   W. Landsman   September 1997
Changed loops to long integer   W. Landsman   December 1998
Added Mac support, translate Windows environment variables, 
& treat case where dirname ends in '/' W. Landsman  Feb. 2000
Assume since V5.5, remove VMS support W. Landsman  Sep. 2006
 number of parameters
e leading/trailing blanks
ccording to operating system
 Windows, if the directory starts with a dollar sign, then check to see
f it's really an environment variable.  If it is, then substitute the
nvironment variable for the directory name.
ppend an ending '\'
Macintosh/UNIX section
ppend path separator
no '/' needed when using default directory