SPEC_DIR
Name
SPEC_DIR()
Purpose
Complete a file specification by appending the default disk or directory
Calling Sequence
File_spec = SPEC_DIR( filename, [ extension ] )
Input
filename - character string giving partial specification of a file
name. Examples for different operating systems include the
following:
Unix: 'pro/test.dat', '$IDL_HOME/test','~/subpro'
MacOS: ':Programs:test'
Windows: '\pro\test.dat','d:\pro\test'
Optional Input
exten - string giving a default file name extension to be used if
filename does not contain one. Do not include the period.
Output
File_spec - Complete file specification using default disk or
directory when necessary.
Example
IDL> a = spec_dir('test','dat')
is equivalent to the commands
IDL> cd, current=cdir
IDL> a = cdir + delim + 'test.dat'
where delim is the OS-dependent separator
Method
SPEC_DIR() decomposes the file name using FDECOMP, and appends the
default directory (obtained from the FILE_EXPAND_PATH) if necessary.
SPEC_DIR() does not check whether the constructed file name actually
exists.
Procedures Called
FDECOMP, EXPAND_TILDE()
Revision History
Written W. Landsman STX July, 1987
Expand Unix tilde if necessary W. Landsman September 1997
Assume since V5.5, use FILE_EXPAND_PATH, remove VMS support
W. Landsman September 2006