LIST_WITH_PATH
Name
LIST_WITH_PATH
Purpose
Search for files in a specified directory path.
Explanation
Lists files in a set of default paths, similar to using FILE_SEARCH,
except that a list of paths to be searched can be given.
Calling Sequence
Result = LIST_WITH_PATH( FILENAME, PATHS )
Inputs
FILENAME = Name of file to be searched for. It may contain wildcard
characters, e.g. "*.dat".
PATHS = One or more default paths to use in the search in case
FILENAME does not contain a path itself. The individual
paths are separated by commas, although in UNIX, colons
can also be used. In other words, PATHS has the same
format as !PATH, except that commas can be used as a
separator regardless of operating system. The current
directory is always searched first, unless the keyword
NOCURRENT is set.
A leading $ can be used in any path to signal that what
follows is an environmental variable, but the $ is not
necessary. Environmental variables can themselves
contain multiple paths.
Outputs
The result of the function is a list of filenames.
Example
FILENAME = ''
READ, 'File to open: ', FILENAME
FILE = LIST_WITH_PATH( FILENAME, 'SERTS_DATA', '.fix' )
IF FILE NE '' THEN ...
Procedure Calls
BREAK_PATH, CONCAT_DIR()
Category
Utilities, Operating_system
Revision History
Version 1, William Thompson, GSFC, 3 November 1994
Documentation modified Wayne Landsman HSTX November 1994
Assume since V5.5, vector call to FILE_SEARCH() W. Landsman Sep 2006
Restore pre-Sep 2006 behavior of not searching subdirectories
W.Landsman. Feb 2007