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

Home » Public Forums » archive » Re: File test
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: File test [message #4430] Wed, 31 May 1995 00:00 Go to previous message
knipp is currently offline  knipp
Messages: 68
Registered: January 1993
Member
In article acg@post.gsfc.nasa.gov, thompson@orpheus.nascom.nasa.gov (William Thompson) writes:

... (deleted)

>
> Actually, that's why I use. I find it extremely fast, much faster than the IDL

^
CORRECT ----------------------------------------------|

> built-in function called FINDFILE. I would, however, suggest modifying your
> routine to read
>
> FUNCTION fexists, file
> ON_IOERROR, error
> openr,unit,file
> free_lun,unit
> ; found the file
> return, 1
>
> error:
> ;can't open the file, so it's probably not there
> return,0
> end
>
> So that you don't run into a problem if unit 1 is already used elsewhere.
>
> Bill Thompson


I have a function EXIST_F (to check the existence of a file) using FINDFILE,
- and just yesterday I suggested to use FINDFILE for this.

Now , thanks to Bill Thompson, I realize that OPENR is much, much faster
- and find a function (I wrote some time ago) EXIST_D, which checks the
existence of a directory, ...
AND IT USES OPENR to perform that check.

So, next time be careful with my suggestions, ;-)
I must be out of my brain sometimes.

(A small difference to the above stated solution:
openr, unit, file, /get_lun, ERROR=ERROR
if ERROR ne 0 then return, 0
free_lun, unit
return, 1
)

By the way, the function EXIST_F now utilizes OPENR,... ;-)

Thanks again Bill

Karl


------------------------------------------------------------ ------------

Karlheinz Knipp
knipp@ipi.uni-hannover.de

------------------------------------------------------------ ------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Spearman rank coeff significance?
Next Topic: IDL alternatives?

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

Current Time: Fri Oct 10 15:20:53 PDT 2025

Total time taken to generate the page: 1.28263 seconds