The FILEPATH function returns the fully-qualified path to a file contained in the IDL distribution. Operating system dependencies are taken into consideration. This routine is used by RSI to make the library routines portable. This routine is written in the IDL language. Its source code can be found in the file
filepath.pro in the
lib subdirectory of the IDL distribution.
Result = FILEPATH( Filename [, ROOT_DIR=string] [, SUBDIRECTORY=string/string_array] [, /TERMINAL] [, /TMP] )
Returns the fully-qualified path to a specified file.
A string containing the name of the file to be found. The file should be specified in all lowercase characters. No device or directory information should be included.
A string containing the name of the directory from which the resulting path should be based. If not present, the value of
The name of the subdirectory in which the file should be found. If this keyword is omitted, the main IDL directory is used. This variable can be either a scalar string or a string array with the name of each level of subdirectory depth represented as an element of the array.
For example, to get a path to the file
filepath.pro in IDL's
lib subdirectory, enter:
path = FILEPATH('filepath.pro',SUBDIR=['lib'])
Set this keyword to return the filename of the user's terminal.
Set this keyword to indicate that the specified file is a scratch file. Returns a path to the proper place for temporary files under the current operating system.
Under Microsoft Windows, FILEPATH checks to see if the following environment variables are set-TMP, TEMP, WINDIR-and uses the value of the first one it finds. If none of these environment variables exists, \TMP is used as the temporary directory.
Open the IDL distribution file
OPENR, 1, FILEPATH('people.dat', SUBDIRECTORY=['examples','data'])
Introduced: Pre 4.0