Re: Directory/file browser as TreeView



Ratcliffe, Jeffrey (Peters) wrote:
Very good script. :)

Seconded! Nice example.

I was trying to keep it short and simple, but you can replace:

 @{$slist->{data}} = <*>;

with
...

Or just

  @{$slist->{data}} = grep(-d, <*>);

But anything using "-d" will require an expensive "stat" of each file.

As for speeding up access to large directories, it is well known that such directory operations are much much faster on the second pass, once the OS has cached all the inodes in memory. So, you just need a way to skip the first pass and go right to the second. I can hardly wait for Perl6 and the quantum spaceship (time-hopping) operator.

Or, probably simpler for now, just do each scan twice.

HTH -- Cheers!

<Joe (... Ducks)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]