www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - std.file

reply Russel Winder <russel winder.org.uk> writes:
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.
=20
--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder ekiga.n=
et
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
Apr 11 2012
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
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
Apr 11 2012
parent Russel Winder <russel winder.org.uk> writes:
Andrei,

On Wed, 2012-04-11 at 09:15 -0500, Andrei Alexandrescu wrote:
[...]
=20
 http://dlang.org/phobos/std_file.html#dirEntries
=20
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. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 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
Apr 11 2012