FILEPATH function returns the
fully-qualified path to a file found in the IDL distribution. Operating system dependencies are taken into consideration. This routine is used by Research Systems to make the library routines portable. This routine is written in the IDL language. Its source code can be found in the file
subdirectory of the IDL distribution.
Result = FILEPATH(
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 !DIR is used. This keyword is ignored if TERMINAL or TMP are specified.
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
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.
On the Macintosh, use of this keyword returns the directory name
:IDL Temp File
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
, found in the
OPENR, 1, FILEPATH('people.dat', SUBDIRECTORY='images')