std.file new functions/classes

jicman jicman_member at pathlink.com
Fri Mar 10 07:11:47 PST 2006


Gosh!  And I was so excited about std.file. ;-)  Well, it's a good thing that we
have std.recls. I hope Walter would, someday, also support the same functions
that are in DirEntry for a file.

Thanks Regan.


Regan Heath says...
>
>On Fri, 10 Mar 2006 07:56:36 +0000 (UTC), jicman  
><jicman_member at pathlink.com> wrote:
>> Has anyone figured out how to use the DirEntry entries for std.file?
>
>I believe DirEntry is currently only used with listdir, eg.
>
>import std.file;
>import std.stdio;
>
>void main()
>{
>	bool showFile(DirEntry* e)
>	{
>		if (e.isdir()) return true;
>		writefln("  ",e.name);
>		return true;
>	}
>	
>	bool showDir(DirEntry* e)
>	{
>		if (!e.isdir()) return true;
>		writefln("  ",e.name);
>		return true;
>	}
>	
>	writefln("Files:");
>	listdir(".",&showFile);
>	writefln("");
>	
>	writefln("Directories:");
>	listdir(".",&showDir);
>	writefln("");
>}
>
>Regan





More information about the Digitalmars-d-learn mailing list