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 #32979 is a reply to message #32920] Fri, 22 November 2002 11:16 Go to previous messageGo to previous message
rigby is currently offline  rigby
Messages: 16
Registered: September 1995
Junior Member
"Mark Hadfield" <m.hadfield@niwa.co.nz> wrote in message news:<ark86l$d77$1@newsreader.mailgate.org>...
> "David Fanning" <david@dfanning.com> wrote in message
> news:MPG.1846c9eb188ae0b1989a3d@news.frii.com...
>> File_Which very sensibly does NOT search any
>> directory that does not contain either a .pro or
>> .sav file. (Why include directories on an IDL
>> search path that can't result in anything productive?
>> Slows everything down.)
>
> What?!
>
> This would be sensible, *if* FILE_WHICH was to be used only to search for
> .pro or .sav files. There is nothing in the documentation that says this is
> the case, and I (and David) have used it to search for files with other
> extensions. I'm just glad it was David who got tripped up by the hidden
> gotcha. (Not that I'm not sympathetic, David, but...)

I believe this isn't a FILE_WHICH problem, but a side effect of IDL's
expansion of the search PATH you requested. For UNIX (all I'm familiar
with) your IDL !PATH variable is built from your UNIX environment
variable PATH. You can prepend a "+" to a directory name in PATH to
ask that all its subdirectories be included in !PATH. But IDL excludes
subdirectories that don't contain .pro or .sav files; apparently IDL
does this path expansion and exclusion by calling Expand_Path() at
startup. (The documentation also says that even explicitly specified
directories in your PATH environment variable will be removed if the
have no .pro, etc, but that doesn't seem to be the case, at least on
my Solaris system.)

For Unix you can work around this by using the ALL_DIRS keyword in
Expand_Path():

IDL> print, getenv("IDL_PATH")
/home/rigby/idl:/home/rigby/idl/utilities:/home/phony2/s0/so ftware/idl5.5/idl_5.5/lib:+/home/rigby/working

;; I asked for /working and its subdirectories to be included, but ...

IDL> print, !path
/home/rigby/idl:/home/rigby/idl/utilities:/home/phony2/s0/so ftware/idl5.5/idl_5.5/lib

;; ... since there are no .pro files in /working or its
subdirectories, IDL
;; didn't include them in !path. The workaround is

IDL> !path = Expand_Path(getenv("IDL_PATH"),/all_dirs)

IDL> print, !path
/home/rigby/idl:/home/rigby/idl/utilities:/home/phony2/s0/so ftware/idl5.5/idl_5.5/lib:/home/rigby/working/subworking:/ho me/rigby/working

Maybe there's some similiar you can do in Windows.

--Wayne
[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:47:27 PDT 2025

Total time taken to generate the page: 0.00413 seconds