Copyright | (c) 2020-2021 Vaclav Svejcar |
---|---|
License | BSD-3-Clause |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module contains mainly helper functions, that are internally used by this library.
Documentation
:: MonadIO m | |
=> FilePath | path to traverse |
-> (FilePath -> m Bool) | predicate to match filename (performing possible I/O actions) |
-> m [FilePath] | list of found paths |
Recursively finds paths on given path whose filename matches the predicate.
Recursively finds all paths on given path. If file reference is passed instead of directory, such path is returned.
:: MonadIO m | |
=> FilePath | path to traverse |
-> (FilePath -> m a) | function to process path (performing possible I/O actions) |
-> m [a] | result of traversed & processed paths |
Recursively walks the given path and performs selected action for each found file. Output of this function is:
- If the given path is file, only this single path is processed and returned.
- If the given path is directory, all subdirectories and files are recursively processed and returned.
- If the given path doesn't exist, empy list will be returned.
If the given path contains backward slashes (Windows style), converts them into forward ones (Unix style).
>>>
toPosixPath "foo\\bar\\x.txt"
"foo/bar/x.txt"
>>>
toPosixPath "foo/bar/x.txt"
"foo/bar/x.txt"