Re: file_search windows problem [message #35070] |
Thu, 15 May 2003 04:00 |
Jacques Basson
Messages: 17 Registered: May 1999
|
Junior Member |
|
|
R.G. Stockwell wrote:
> "Jacques Basson" <basson@cyclopsNoSpAmnu.ac.za> wrote in message
> news:1052909384.778379@osprey.und.ac.za...
>
>> Hi all
>
> ...
>
>> IDL> print, findfile('C:\tmp\*B9*')
>> C:\tmp\123456789E.dat C:\tmp\1234567B9E.dat
>
> ...
>
>> Does anyone have any suggestion for a workaround?
>>
>> Cheers,
>> Jacques
>
>
>
> huh! weird, i've not noticed this behaviour before. I might even say
> it's a bug. Certainly performs counterintuitively.
>
> Anyways, an obvious solution is just to select the files from your returned
> array yourself
> (with perhaps a strupcas() if you want case independence)
>
> files = findfile('C:\tmp\*B9*')
> w = where(strpos(strupcase(files),'B9') gt 0,count)
> if count gt 0 then files=files[w] else files='NULL'
> print,files
>
>
> Cheers,
> bob
>
In some circles it would be called a "feature" rather than a bug... I
was hoping that there may be a more elegant solution than searching the
returned array, but I'll go with that for now.
Thanks,
Jacques
|
|
|
Re: file_search windows problem [message #35089 is a reply to message #35070] |
Wed, 14 May 2003 07:27  |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
"Jacques Basson" <basson@cyclopsNoSpAmnu.ac.za> wrote in message
news:1052909384.778379@osprey.und.ac.za...
> Hi all
...
> IDL> print, findfile('C:\tmp\*B9*')
> C:\tmp\123456789E.dat C:\tmp\1234567B9E.dat
...
> Does anyone have any suggestion for a workaround?
>
> Cheers,
> Jacques
huh! weird, i've not noticed this behaviour before. I might even say
it's a bug. Certainly performs counterintuitively.
Anyways, an obvious solution is just to select the files from your returned
array yourself
(with perhaps a strupcas() if you want case independence)
files = findfile('C:\tmp\*B9*')
w = where(strpos(strupcase(files),'B9') gt 0,count)
if count gt 0 then files=files[w] else files='NULL'
print,files
Cheers,
bob
|
|
|