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

Home » Public Forums » archive » Re: Mark directory for exclusion from !PATH
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: Mark directory for exclusion from !PATH [message #38125] Mon, 23 February 2004 08:23 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Sun, 22 Feb 2004 16:11:29 -0800, Andrew Cool wrote:

> JD Smith <jdsmith@as.arizona.edu> wrote in message news:<pan.2004.02.20.23.58.16.472234@as.arizona.edu>...
>> On Fri, 20 Feb 2004 17:00:58 -0500, Wayne Landsman wrote:
>>
>>> JD Smith wrote:
>> I just whipped up a little routine to let me mark directories which
>> contain a file IDL_IGNORE. These directories, and, optionally, all
>> their subdirectories, are then removed from the !PATH. I call it at
>> startup and it works a treat. Now I can just keep everything in
>> ~/idl, make !PATH start with +~/idl, and mark and unmark directories
>> with a simple file: no more futzing with !PATH.

> JD,
>
> Under Windows (IDL v6.0) at least, dirs=strsplit(!PATH,':',/EXTRACT) returns
> directory strings in this format :- \IDL\ZZZ_camdemo\;C
> whereas using a semi-colon to split the Path returns :-
> C:\IDL\ZZZ_camdemo\, which works a whole lot better ... ;-)
>
> The STRJOIN could do with a ';' too.

Aha... I guess all the C: stuff does mess it up. Here's a portable
version (I hope). I've been using the 'IDL_IGNORE' file method for a
few days, and I really like it. Perhaps RSI will pick up on the
concept and build it into their path search.

JD

pro prune_idl_ignore,RECURSIVE=rcrsv,VERBOSE=vb
dirs=strsplit(!PATH,path_sep(/SEARCH_PATH),/EXTRACT)
sweep=file_test(dirs+path_sep()+'IDL_IGNORE',/REGULAR)
if keyword_set(rcrsv) then begin
wh=where(sweep,cnt)
if cnt gt 0 then begin
for i=0,cnt-1 do begin
wh_root=where(strpos(dirs,dirs[wh[i]]) eq 0,root_cnt)
if root_cnt gt 0 then sweep[wh_root]=1b
endfor
endif
endif
good=where(sweep eq 0,ngood)
if keyword_set(vb) then begin
bad=where(sweep,nbad)
print,'Pruning ',strtrim(nbad,2),' !PATH dirs:'
if nbad gt 0 then print,' '+dirs[bad]
endif
if ngood eq 0 then return
!PATH=strjoin(dirs[good],path_sep(/SEARCH_PATH))
end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: String composition
Next Topic: Re: Array string

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

Current Time: Wed Oct 08 15:06:52 PDT 2025

Total time taken to generate the page: 0.00422 seconds