![]() |
Institut für Astronomie und AstrophysikAbteilung AstronomieWaldhäuser Str. 64, D-72076 Tübingen, Germany |
![]() |
SPEC_DIR
Complete a file specification by appending the default disk or directory
File_spec = SPEC_DIR( filename, [ extension ] )
filename - character string giving partial specification of a file
name. Examples for different operating systems include the
following:
VMS: '$1$DUA5:TEST.DAT','[.SUB]TEST'
Unix: 'pro/test.dat', '$IDL_HOME/test','~/subpro'
MacOS: ':Programs:test'
Windows: '\pro\test.dat','d:\pro\test'
exten - string giving a default file name extension to be used if
filename does not contain one. Do not include the period.
File_spec - Complete file specification using default disk or
directory when necessary.
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
SPEC_DIR() decomposes the file name using FDECOMP, and appends the
default directory (obtained from the CD command) if necessary.
Under VMS, SPEC_DIR() will also try to translate disk and directory
logical names.
SPEC_DIR() does not check whether the constructed file name actually
exists.
EXPAND_TILDE(), FDECOMP
Written W. Landsman STX July, 1987
Added Unix compatibility, W. Landsman, STX August 1991
Added Windows and Macintosh compatibility W. Landsman September, 1995
Work for relative Unix directory W. Landsman May, 1997
Expand Unix tilde if necessary W. Landsman September 1997
Converted to IDL V5.0 W. Landsman September 1997
Fix VMS call to TRNLOG() W. Landsman September 2000
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]