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

Home » Public Forums » archive » filename check
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: filename check [message #22222 is a reply to message #22084] Tue, 24 October 2000 00:00 Go to previous messageGo to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
"Stuart Colley" <src@star.ucl.ac.uk> wrote...
>
> Can anyone suggest a way to check that a file exists before attempting to
> read from it, since the error messages obtained from trying to read from a
> non-existing file, don't make it clear that file doesn't exist.

Of course, the solutions in all the other replies point to why this was
needed, and now appears in IDL 5.4:

IDL> Print, File_Test('image.gif')
0
IDL> Print, File_Test('image.tif')
1

File_Test has many fancy keywords for "what kind of file do you expect to
find?", etc.:

[, /DIRECTORY | , /EXECUTABLE | , /READ | , /REGULAR | , /WRITE | ,
/ZERO_LENGTH] [, GET_MODE=variable]

Cheers,
--
-Dick

Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / Voice/Fax: +1-403-242-7398
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: ENVI slope function
Next Topic: Re: HELP: How to read 10-bit image file

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

Current Time: Sat Oct 11 06:11:09 PDT 2025

Total time taken to generate the page: 1.52010 seconds