comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » tilde file names in FINDFILE
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
tilde file names in FINDFILE [message #10013] Fri, 26 September 1997 00:00 Go to next message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Hi everyone,

I am still using IDL 4 and AIX 3.2.5, but that shouldn't really matter
for the following question, I suppose:

When I am opening a file with
OPENR,unit,'~/IDL/DATA/test.dat',/get_lun
it works fine. But if I try to find that file via
PRINT,FINDFILE('~/IDL/DATA/test.dat')
I get an empty string indicating that IDL did not find it.

Does anyone know how to teach IDL to accept the '~' in FINDFILE ?
One option might be to use SPAWN,'echo $HOME',result but
(a) is this highly OS dependent
(b) does it not work for something like ~user/file.dat
Any ideas appreciated !

Martin Schultz


------------------------------------------------------------ ---------
Dr. Martin Schultz
Department of Earth&Planetary Sciences, Harvard University
186 Pierce Hall, 29 Oxford St
Cambridge, MA 02138, USA

e-mail : mgs@io.harvard.edu
idl web page: http://www-as.harvard.edu/people/staff/mgs/idl/
------------------------------------------------------------ ---------
Re: tilde file names in FINDFILE [message #10073 is a reply to message #10013] Thu, 02 October 1997 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
William Thompson wrote:
>
> Martin Schultz <mgs@io.harvard.edu> writes:
>
>> Hi everyone,
>
>> I am still using IDL 4 and AIX 3.2.5, but that shouldn't really matter
>> for the following question, I suppose:
>
>> When I am opening a file with
>> OPENR,unit,'~/IDL/DATA/test.dat',/get_lun
>> it works fine. But if I try to find that file via
>> PRINT,FINDFILE('~/IDL/DATA/test.dat')
>> I get an empty string indicating that IDL did not find it.
>
>> Does anyone know how to teach IDL to accept the '~' in FINDFILE ?
>> One option might be to use SPAWN,'echo $HOME',result but
>> (a) is this highly OS dependent
>> (b) does it not work for something like ~user/file.dat
>> Any ideas appreciated !
>
> This routine should do the trick, thanks to my colleague Dominic Zarro.
>
[... cut]

Thanks !

Actually, I received an e-mail suggesting to use the
expand_path() function, and this works, too. You can check routine
file_exist on my website (http below) how I use it now.

Thanks again, anyway,
Martin.

------------------------------------------------------------ ------------Dr.
Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
186 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-9837
Please indicate name and room (186 Pierce) when sending a fax

e-mail: mgs@io.harvard.edu
IDL-homepage: http://www-as.harvard.edu/people/staff/mgs/idl/
------------------------------------------------------------ ------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Print Quality
Next Topic: contour

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:34:04 PDT 2025

Total time taken to generate the page: 0.00698 seconds