Safe Haskell | None |
---|
- data FileEntry = FileEntry {}
- newtype Predicate m = Predicate (FileEntry -> m (Maybe FileEntry, Maybe (Predicate m)))
- sourceFileEntries :: MonadResource m => Bool -> Predicate m -> FilePath -> Producer m FileEntry
- matchAll :: Monad m => Predicate m
- ignoreVcs :: MonadIO m => Predicate m
- regexMatcher :: Monad m => (FilePath -> FilePath) -> Bool -> Text -> Predicate m
- regex :: Monad m => Text -> Predicate m
- glob :: Monad m => Text -> Predicate m
Documentation
sourceFileEntries :: MonadResource m => Bool -> Predicate m -> FilePath -> Producer m FileEntrySource
Walk through the entries of a directory tree, allowing the user to
specify a Predicate
which may decides not only which entries to yield
from the conduit, but also which directories to follow, and how to
recurse into that directory by permitting the use of a subsequent
Predicate
.
Note that the followSymlinks
parameter to this function has a different
meaning than it does for sourceDirectoryDeep
: if True
, symlinks are
never passed to the predicate, only what they point to; if False
,
symlinks are never read at all. For sourceDirectoryDeep
, if
followSymlinks
is False
it only prevents directory symlinks from
being read.
matchAll :: Monad m => Predicate mSource
Return all entries. This is the same as sourceDirectoryDeep
, except
that the FileStatus
structure for each entry is also provided. As a
result, only one stat call is ever made per entry, compared to two per
directory in the current version of sourceDirectoryDeep
.
ignoreVcs :: MonadIO m => Predicate mSource
Return all entries, except for those within version-control metadata directories (and not including the version control directory itself either).
:: Monad m | |
=> (FilePath -> FilePath) | Function that specifies which part of the pathname to match against. Use this to match against only filenames, or to relativize the path against the search root before comparing. |
-> Bool | If True, prune directories from the search that do not match. |
-> Text | The regular expression search pattern. |
-> Predicate m |
The regexMatcher
predicate builder matches some part of every path
against a given regex. Use the simpler regex
if you just want to apply
a regex to every file name.