Safe Haskell | Safe-Infered |
---|
File finding utiliites for Shelly
The basic find
takes a dir and gives back a list of files.
If you don't just want a list, use the folding variants like findFold
.
If you want to avoid traversing certain directories, use the directory filtering variants like findDirFilter
- find :: FilePath -> ShIO [FilePath]
- findWhen :: FilePath -> (FilePath -> ShIO Bool) -> ShIO [FilePath]
- findFold :: FilePath -> a -> (a -> FilePath -> ShIO a) -> ShIO a
- findDirFilter :: FilePath -> (FilePath -> ShIO Bool) -> ShIO [FilePath]
- findDirFilterWhen :: FilePath -> (FilePath -> ShIO Bool) -> (FilePath -> ShIO Bool) -> ShIO [FilePath]
- findFoldDirFilter :: FilePath -> (FilePath -> ShIO Bool) -> a -> (a -> FilePath -> ShIO a) -> ShIO a
Documentation
find :: FilePath -> ShIO [FilePath]Source
List directory recursively (like the POSIX utility find). listing is relative if the path given is relative. If you want to filter out some results or fold over them you can do that with the returned files. A more efficient approach is to use one of the other find functions.
findWhen :: FilePath -> (FilePath -> ShIO Bool) -> ShIO [FilePath]Source
find
that filters the found files as it finds.
Files must satisfy the given filter to be returned in the result.
findDirFilter :: FilePath -> (FilePath -> ShIO Bool) -> ShIO [FilePath]Source
find
that filters out directories as it finds
Filtering out directories can make a find much more efficient by avoiding entire trees of files.
:: FilePath | directory |
-> (FilePath -> ShIO Bool) | directory filter |
-> (FilePath -> ShIO Bool) | file filter |
-> ShIO [FilePath] |
similar findWhen
, but also filter out directories
Alternatively, similar to findDirFilter
, but also filter out files
Filtering out directories makes the find much more efficient
findFoldDirFilter :: FilePath -> (FilePath -> ShIO Bool) -> a -> (a -> FilePath -> ShIO a) -> ShIO aSource
like findDirFilterWhen
but use a folding function rather than a filter
The most general finder: you likely want a more specific one