shelly-0.12.0.1: shell-like (systems) programming in Haskell

Safe HaskellSafe-Infered

Shelly.Find

Description

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

Synopsis

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.

findFold :: FilePath -> a -> (a -> FilePath -> ShIO a) -> ShIO aSource

Fold an arbitrary folding function over files froma a find. Like findWhen but use a more general fold rather than a filter.

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.

findDirFilterWhenSource

Arguments

:: 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