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

Home » Public Forums » archive » File_Which What!?
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_Which What!? [message #33017 is a reply to message #32920] Thu, 21 November 2002 03:56 Go to previous messageGo to previous message
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
David Fanning wrote:

> Folks,
>
> Does anyone know how to get the File_Which command to work?
> The documentation is, uh, typical.
>
> I have a file somewhere on my IDL path. It's name is "fire.clt".
> I'm in a directory NOT on my path (my home directory), but I
> would like to know where this file is.
>
> The documentation says that the first positional parameter
> is the "path", and the second is the "file" you are searching
> for. Then it says, if the "path" is missing, then the IDL
> path is used instead. But, wait, if the first positional
> parameter is "missing", isn't the "file" the first positional
> parameter!? Here is a new trick!
>

Has the documentation changed for 5.6?
I only have 5.5 and the docs for that show the syntax as:
Result = FILE_WHICH( [Path, ] File [, /INCLUDE_CURRENT_DIR] )
and don't make any mention of first and second positional parameters, but
this does indicate that "path" is optional.

> In any case, File_Which is coming back to me with a
> empty string. Not what I had in mind? :-(
>
> Anyone figure this out?

It works here, with IDL 5.5 on IRIX. (I created a file called "fire.clt" at
some location in the IDL path and FILE_WHICH found it ok). Looking at the
source, FILE_WHICH uses FILE_TEST to test for the file. It loops through
each directory in the path testing for the file in that directory until it
either succeeds or runs out of entries in the path. Does FILE_TEST indicate
success if you use that with the full path?


--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Structure Pass By Reference?
Next Topic: Re: sec : U Re: De-sensitizing individual list elements

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

Current Time: Wed Oct 08 19:42:41 PDT 2025

Total time taken to generate the page: 0.00520 seconds