listdir

Daniel Kozak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 14 08:11:39 PDT 2017


There is no such function in D2

You can use dirEntries

https://dlang.org/phobos/std_file.html#.dirEntries.2


Dne 14.3.2017 v 16:04 hadas via Digitalmars-d-learn napsal(a):
> Hi,
> I'm trying to read all the txt files in specific path.
> I tried to use listdir function, but I get this error:
> Error: undefined identifier 'listdir' in module 'std.file'
>
>
>
>
>
> import std.stdio;
> import std.file;
>
> void main(string[] args)
> {
>
> auto vm_files = std.file.listdir("C:/Users/hadas/Documents/d", "*.txt");
>
>     foreach(d;vm_files)
>         writeln(d);
>
> }
>



More information about the Digitalmars-d-learn mailing list