utils.fileutils

Utilities for interacting with the file system.

Members

Functions

copyDir
void copyDir(string sourceDir, string destDir)

Copies all files from the given source directory, to the given destination directory. Will create the destination directory if it doesn't exist yet. Overwrites any files that already exist in the destination directory.

findFile
string findFile(string dir, string pattern, bool recursive, int maxDepth)

Tries to find a single file matching the given pattern.

findFiles
string[] findFiles(string dir, string pattern, bool recursive, int maxDepth)

Finds matching files in a directory.

findFilesByExtension
string[] findFilesByExtension(string dir, string extension, bool recursive, int maxDepth)

Finds all files in a directory that end with the given extension text.

isDirEmpty
bool isDirEmpty(string dir)

Checks if a directory is empty.

walkDir
void walkDir(string dir, void delegate(DirEntry entry) visitor, bool recursive, int maxDepth)

Walks through all the entries in a directory, and applies the given visitor function to all entries.

walkDirFiles
void walkDirFiles(string dir, void delegate(DirEntry entry) visitor, bool recursive, int maxDepth)

Walks through all files in a directory.

walkDirFiltered
void walkDirFiltered(string dir, void delegate(DirEntry entry) visitor, bool delegate(DirEntry entry) filter, bool recursive, int maxDepth)

Walks through all the entries in a directory, and applies the given visitor function to all entries for which a given filter function returns true.

Meta