Directory Module
Walks up the directory tree from a start directory and returns the first directory that meets a condition or holds a given file, or None when no directory does. The module has the same name as the System.IO.Directory class and hides the class in a file that opens both, so the module calls the class by the full name System.IO.Directory.
Functions and values
| Function or value |
Description
|
Full Usage:
Directory.tryFindDirWithFile fileName startDir
Parameters:
string
startDir : string
Returns: string option
|
The first directory at or above startDir that directly contains a file named fileName, probed by exact path.
|
Full Usage:
Directory.tryFindFileUpward fileName startDir
Parameters:
string
startDir : string
Returns: string option
|
The full path of the first file named fileName at or above
startDir, or
|
Full Usage:
Directory.tryFindParent fileToFind startDir
Parameters:
string
startDir : string
Returns: string option
|
The first directory at or above startDir that contains a file whose name matches fileToFind ignoring case. Accepts a file as startDir and starts from its directory. Never throws. The guard is per directory: one that cannot be enumerated (permissions) counts as "no match" and the walk continues upward.
|
Full Usage:
Directory.tryFindUpward found startDir
Parameters:
string -> bool
-
Predicate tested against each directory on the way up.
startDir : string
-
The directory to start the upward search from.
Returns: string option
The first matching directory, or None if none matches.
|
Walk up the directory tree from startDir (inclusive),
returning the first directory for which found holds,
or
|
GenPRES