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

Home » Public Forums » archive » Re: Findfile in large directories
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 in large directories [message #50624 is a reply to message #50598] Fri, 06 October 2006 11:26 Go to previous messageGo to previous message
George N. White III is currently offline  George N. White III
Messages: 56
Registered: September 2000
Member
On Fri, 6 Oct 2006, Wox wrote:

> Dear All,
>
> In a widget application I'm making, I have "next file", "previous
> file" buttons which do the following:
> ...
> path = findfile(list.path+'*'+list.Format)
> nfiles = n_elements(path)
> path = SortListFiles(path,list.sortmethod,list.sortseparator)
> ind = where(path eq list.path+list.file,count)
> ...
> <take next or previous file (if any) and read/display it>
> ...
>
> The current loaded file is "list.path+list.file". SortListFiles sorts
> the files (in general not just string sort).
>
> However, in directories with up to 1000 or more files (usually also on
> an SMB mounted drive), this is rather slow (findfile takes most time).
>
> Any ideas how to make this faster?

If the contents of the directories are not updated too often you can
generate a cached list of the files. This is essentially what is done by
most TeX (math typesetting) implementations, using the unix "ls -R"
command to cache the names for a directory tree.

--
George N. White III <aa056@chebucto.ns.ca>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: difference between icontour and contour?
Next Topic: Findfile in large directories

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

Current Time: Sun Oct 12 01:31:10 PDT 2025

Total time taken to generate the page: 0.08157 seconds