FILEPATH bug/feature in IDL for Windows [message #1470] |
Wed, 29 September 1993 14:35 |
hadfield
Messages: 11 Registered: October 1993
|
Junior Member |
|
|
A problem and a solution: When its TMP keyword is set, the USERLIB function
FILEPATH in IDL (version 3.1) is supposed to return a fully-qualified pathname
in the "proper place for temporary files under the current operating system".
On my system that is 'c:\temp'. FILEPATH gives:
IDL> print,filepath('foo.dat',/tmp)
\tmp\foo.dat
There is no \tmp directory! The solution is to replace the following code:
IF (do_tmp) THEN BEGIN
CASE !VERSION.OS OF
...
'windows': root_dir = '\tmp'
with
IF (do_tmp) THEN BEGIN
CASE !VERSION.OS OF
...
'windows': root_dir = getenv('temp')
whence
IDL> print,filepath('foo.dat',/tmp)
C:\temp\foo.dat
The environment variable 'temp' has to be defined. To the best of my
recollection a line to do this is added to autoexec.bat in a standard Windows
installation.
============================================================ ===========
Mark Hadfield NIWA Oceanographic (Taihoro Nukurangi)
hadfield@storm.greta.cri.nz Wellington, New Zealand
|
|
|