| Thread overview | |||||
|---|---|---|---|---|---|
|
April 11, 2012 std.file | ||||
|---|---|---|---|---|
| ||||
Attachments:
| I am hoping I am failing to see the entry in the documentation due to...
Python, Java and Groovy (at least, probably other languages) have functions for iterating over directory hierarchies, i.e. tree walkers / visitors. For example in Python:
for root , directories , files in os.walk ( '.' ) :
doStuff ( files )
I can see in std.file the tools needed to do this by hand, but I would have thought in this day and age such a function should be in the standard library. Thus I am hoping I am just missing it...
Thanks.
--
Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
| |||
April 11, 2012 Re: std.file | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | On 4/11/12 9:07 AM, Russel Winder wrote: > I am hoping I am failing to see the entry in the documentation due to... > > Python, Java and Groovy (at least, probably other languages) have > functions for iterating over directory hierarchies, i.e. tree walkers / > visitors. For example in Python: > > for root , directories , files in os.walk ( '.' ) : > doStuff ( files ) > > I can see in std.file the tools needed to do this by hand, but I would > have thought in this day and age such a function should be in the > standard library. Thus I am hoping I am just missing it... http://dlang.org/phobos/std_file.html#dirEntries Andrei | |||
April 11, 2012 Re: std.file | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu Attachments:
| Andrei, On Wed, 2012-04-11 at 09:15 -0500, Andrei Alexandrescu wrote: [...] > > http://dlang.org/phobos/std_file.html#dirEntries > Aha, I missed the SpanMode parameter and thought this function only dealt with the current directory without descending. (Note to self: must *read* the manual instead of just skimming it.) Thanks. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply