dirname.pro


Name:
dirname
Syntax:
dir = dirname('c:/idl/lib/file.pro')
Arguments:
string filename
Return value:
Returns the directory (i.e. the path) of filename, without a
trailing separator. If no path could be found, an empty string
is returned. If the last character of the argument is a path
separator, the argument is interpreted as a 'pure' path and
returned as is (with the last separator cut off).
Please note that IDL's built-in file_dirname always
removes the last element (file or part of path) of the argument,
so this implementation hopefully makes a bit more sense.
OS issues (different separators) are taken into account.
Example code:
directory = dirname('F:\IDL\docu\wassweissich.html')
will return F:\IDL\docu
print, dirname('F:\IDL\docu\'), '   ', dirname('F:\idl\docu')
will print  F:\IDL\docu   F:\idl

Last modified: Mon Nov 29 13:30:05 2004