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

Home » Public Forums » archive » findfile gives 'Array has a corrupted descriptor' error
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: findfile gives 'Array has a corrupted descriptor' error [message #85339 is a reply to message #85338] Fri, 26 July 2013 08:34 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
wlandsman writes:

>
> On Thursday, July 25, 2013 8:44:55 PM UTC-4, b_...@hotmail.com wrote:
>
>> Assuming that this is a bug that will not be fixed, does anyone have a fast alternative to file_search?
>
> Not a direct answer but I do notice on the Mac that file_search() is slow only on the first call:
>
> IDL> tic & a = file_search('.','*.pro',/nosort) & toc
> % Time elapsed: 41.371398 seconds.
>
> IDL> tic & a = file_search('.','*.pro',/nosort) & toc
> % Time elapsed: 0.45945001 seconds.
>
>
> So file_search() was of order 100 times faster on the second call. This is similar to the Unix find command which stores the information of a search to speed up the processing on subsequent calls.
> (I included /nosort because that is supposed to speed things up somewhat but it seemed to make little difference on the Mac).
>
> If your recursive search includes a lot of unnecessary directories, then it might be quicker to use a vector of plausible directories in you file_search() call, rather than searching every directory below the specified one. --Wayne

The speed up doesn't seem to be so pronounced on Windows:

IDL> tic & a = file_search('.','*.pro',/nosort) & toc
Elapsed Time: 9.873000
IDL> tic & a = file_search('.','*.pro',/nosort) & toc
Elapsed Time: 5.622000
IDL> tic & a = file_search('.','*.pro',/nosort) & toc
Elapsed Time: 5.600000

This command found 5128 files.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Multiple plots with plot function
Next Topic: Ugly UNIX IDL Workbench

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

Current Time: Thu Oct 09 22:25:15 PDT 2025

Total time taken to generate the page: 1.04132 seconds