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

Home » Public Forums » archive » Re: 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 #22076 is a reply to message #22075] Tue, 24 October 2000 00:00 Go to previous messageGo to previous message
mole6e23 is currently offline  mole6e23
Messages: 31
Registered: December 1998
Member
In article
<Pine.OSF.3.96.1001024143333.20360F-100000@zuaxp7.star.ucl.ac.uk>, 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.
>
> cheers,
> S

;; The following requires IDL 5.3 or higher...
;; if you don't have it, you'll have to figure
;; out the type yourself using the normal size
;; function
function file_exists, fileName

if( size( fileName, /type ) ne 7 ) then return, 0

fileList = findfile( fileName )
if( fileList[0] eq '' ) then return, 0 else return, 1

end ;; file_exists

--

Good luck!
Todd
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Drive detection on win
Next Topic: Re: Non-linear axis

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

Current Time: Thu Oct 09 21:03:18 PDT 2025

Total time taken to generate the page: 0.72320 seconds