View source code
							
							
						
								Display the source code in std/file.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla issue.
							
						
							
								Improve this page
							
							
					
								Quickly fork, edit online, and submit a pull request for this page.
								Requires a signed-in GitHub account. This works well for small changes.
								If you'd like to make larger changes you may want to consider using
								local clone.
							
						Function std.file.dirEntries
Returns an input range
    of DirEntry that lazily iterates a given directory,
    also provides two ways of foreach iteration. The iteration variable can be of
    type string if only the name is needed, or DirEntry
    if additional details are needed. The span mode dictates how the
    directory is traversed. The name of each iterated directory entry
    contains the absolute or relative path (depending on pathname).
						
				auto std
				  string path,
				
				  SpanMode mode,
				
				  bool followSymlink = true
				
				);
				
				
				auto std
				  string path,
				
				  string pattern,
				
				  SpanMode mode,
				
				  bool followSymlink = true
				
				);
						
					
				Parameters
Returns
An input range of
        DirEntry.
Throws
FileException if the directory does not exist.
Example
// Iterate a directory in depth
foreach (string name; dirEntries("destroy/me", SpanModeExample
Duplicate functionality of D1's std:
string[] listdir(string pathname)
{
    import stdAuthors
License
					Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.