![]() |
Institut für Astronomie und AstrophysikAbteilung AstronomieSand 1, D-72076 Tübingen, Germany |
![]() |
FDECOMP
Routine to decompose file name(s) for any operating system. V5.3 or later
FDECOMP, filename, disk, dir, name, qual, version, [OSFamily = ]
filename - string file name(s), scalar or vector
All the output parameters will have the same number of elements as
input filename
disk - disk name, always '' on a Unix machine, scalar or vector string
dir - directory name, scalar or vector string
name - file name, scalar or vector string
qual - qualifier, set equal to the characters beyond the last "."
version - version number, always '' on a non-VMS machine, scalar string
OSFamily - one of the four scalar strings specifying the operating
system: 'vms','Windows','MacOS' or 'unix'. If not supplied,
then !VERSION.OS_FAMILY is used to determine the OS.
Consider the following file names
unix: file = '/rsi/idl40/avg.pro'
vms: file = '$1$dua5:[rsi.idl40]avg.pro;3
MacOS: file = 'Macintosh HD:Programs:avg.pro'
Windows: file = 'd:\rsi\idl40\avg.pro'
then IDL> FDECOMP, file, disk, dir, name, qual, version
will return the following
Disk Dir Name Qual Version
Unix: '' '/rsi/idl40/' 'avg' 'pro' ''
VMS: '$1$dua5' '[RSI.IDL40]' 'avg' 'pro' '3'
Mac: 'Macintosh HD' ':Programs:' 'avg' 'pro' ''
Windows: 'd:' \rsi\idl40\ 'avg' 'pro' ''
(1) All tokens are removed between
1) name and qual (i.e period is removed)
2) qual and ver (i.e. VMS semicolon is removed)
(2) On VMS the filenames "MOTD" and "MOTD." are distinguished by the
fact that qual = '' for the former and qual = ' ' for the latter.
None.
version 1 D. Lindler Oct 1986
Include VMS DECNET machine name in disk W. Landsman HSTX Feb. 94
Converted to Mac IDL, I. Freedman HSTX March 1994
Converted to IDL V5.0 W. Landsman September 1997
Major rewrite to accept vector filenames V5.3 W. Landsman June 2000
Fix cases where disk name not always present W. Landsman Sep. 2000
Make sure version defined for Windows W. Landsman April 2004
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]