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 #38142 is a reply to message #38125] Sun, 22 February 2004 16:11 Go to previous messageGo to previous message
andrew.cool is currently offline  andrew.cool
Messages: 47
Registered: July 2003
Member
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
>
> pro prune_idl_ignore,RECURSIVE=rcrsv
> dirs=strsplit(!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 ngood eq 0 then return
> !PATH=strjoin(dirs[good],':')
> end

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.

Andrew
[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: Sat Oct 11 05:02:19 PDT 2025

Total time taken to generate the page: 0.42666 seconds