Logo

Programming-Idioms

History of Idiom 180 > diff from v11 to v12

Edit summary for version 12 by cym13:
[D] Respect the assignment's variable names

Version 11

2019-03-19, 16:06:03

Version 12

2019-03-19, 16:10:26

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;
Imports
import std.file;
import std.array;
Code
auto x = dirEntries("d", SpanMode.shallow).array;
Code
auto x = dirEntries(d, SpanMode.shallow).array;
Comments bubble
dirEntries is lazy and supports many traversal strategies.
Comments bubble
dirEntries is lazy and supports many traversal strategies.
Doc URL
https://dlang.org/phobos/std_file.html#dirEntries
Doc URL
https://dlang.org/phobos/std_file.html#dirEntries