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

Home » Public Forums » archive » parse subdirectories
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: parse subdirectories [message #94269 is a reply to message #94262] Thu, 16 March 2017 05:29 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Wednesday, March 15, 2017 at 9:05:25 PM UTC+1, Helder wrote:
> On Wednesday, March 15, 2017 at 7:23:46 PM UTC+1, alx wrote:
>> Le mercredi 15 mars 2017 16:02:42 UTC+1, Helder a écrit :
>>> On Tuesday, March 14, 2017 at 12:04:15 AM UTC+1, Helder wrote:
>>>> Thanks for the insight Wayne.
>>>> I think I will go for the sort/count slashes option. Otherwise programming is no fun.
>>>> Cheers, Helder
>>>
>>> Ok,
>>> so I managed this and it is working fine. The improvement is there: crawling through 2000 sub-directories takes ~9 seconds against the >14 sec with the old file_search method.
>>> Now the time to execute is limited by the spawn command (8.5 sec), whereas before it was limited by the file_search (13 sec).
>>> If anybody requests it and I have time I'll put the code together in a "nicer" way.
>>> Cheers,
>>> Helder
>>
>> Maybe you could simply reorder your string array first by using SORT ?
>>
>> print, result[sort(result)]
>>
>> K:\data\sub-1\2002                        
>> K:\data\sub-1\2002\02_01_26              
>> K:\data\sub-1\2002\02_01_28              
>> K:\data\sub-1\2004                        
>> K:\data\sub-1\2004\04_12_02              
>> K:\data\sub-1\2004\04_12_03              
>> K:\data\sub-1\2005                        
>> K:\data\sub-1\2017                        
>
> Hi Alx,
> that's indeed *one* of the things I have to do. However, there's more to it than plain sorting. This because I want to maintain the physical tree structure: therefore I have to determine if any given directory is a node or a leaf and index it accordingly.
> Since I like to use this a lot - and wonder why this isn't already available - I will try to order/clean things up and share it when it's done.
>
> What it does not do and will no do, is follow symbolic links and I will not test this on a linux/mac machine (simply don't have one). If anybody is interested, we can share the load :-)
>
> Cheers,
> Helder

Ok, so I loaded this up on github with an example:
https://github.com/heldermarchetto/IDL
I'm not that much into github, so if you want to contribute/improve the procedure, you're welcome. Let me know if I can do anything about it.
The notifications are not really set-up and I think I don't need to... I'll check that later.

I had someone test this for me with a much bigger directory tree and the improvement was from 2'17" to 51". Nice.

I think that this procedure will not be useful for small directories! It will probably be slower, and that is because of the spawn call to the powershell.

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Harris seems to be deemphasizing IDL
Next Topic: Problem writing SCATTERPLOT() with more than 4096 points to PDF file

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

Current Time: Wed Oct 08 18:22:26 PDT 2025

Total time taken to generate the page: 0.00529 seconds