Logo

Programming-Idioms

History of Idiom 180 > diff from v12 to v13

Edit summary for version 13 by cym13:
[D] Shave unecessary code off.

Version 12

2019-03-19, 16:10:26

Version 13

2019-03-19, 16:21:17

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;
Code
auto x = dirEntries(d, SpanMode.shallow).array;
Code
auto x = dirEntries(d, SpanMode.shallow);
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