Logo

Programming-Idioms

History of Idiom 180 > diff from v10 to v11

Edit summary for version 11 by cym13:
New D implementation by user [cym13]

Version 10

2019-02-11, 19:56:22

Version 11

2019-03-19, 16:06:03

Idiom #180 List files in directory

Create list x containing the contents of directory d.

x may contain files and subfolders.
No recursive subfolder listing.

Idiom #180 List files in directory

Create list x containing the contents of directory d.

x may contain files and subfolders.
No recursive subfolder listing.

Extra Keywords
folder ls dir listing
Extra Keywords
folder ls dir listing
Imports
import std.file;
import std.array;
Code
auto x = dirEntries("d", SpanMode.shallow).array;
Comments bubble
dirEntries is lazy and supports many traversal strategies.
Doc URL
https://dlang.org/phobos/std_file.html#dirEntries