Safe Haskell | Safe-Inferred |
---|
System.Path
Description
A collection of file system utilities that appear to be missing from Directory, FilePath, Prelude, etc. Some of these may overlap with MissingH but the versions here will probably be more simplistic. Furthermore, this library is focused on this one thing and not a whole bunch of things.
- mtreeList :: Monad m => (a -> m [a]) -> a -> m [a]
- fileList :: FilePath -> IO [FilePath]
- walkDir :: FilePath -> IO [Directory]
- copyDir :: FilePath -> FilePath -> IO ()
- replaceRoot :: FilePath -> FilePath -> FilePath -> FilePath
- removeRoot :: FilePath -> FilePath -> FilePath
- data Directory
- dirPath :: Directory -> FilePath
- subDirs :: Directory -> [FilePath]
- files :: Directory -> [FilePath]
- createDir :: FilePath -> IO Directory
Documentation
mtreeList :: Monad m => (a -> m [a]) -> a -> m [a]Source
Returns a list of nodes in a tree via a depth-first walk.
fileList :: FilePath -> IO [FilePath]Source
Recursively list the contents of a directory. Depth-first.
walkDir :: FilePath -> IO [Directory]Source
Walk a directory depth-first. Similar to Python's os.walk and fs.core/walk from the fs Clojure library.
copyDir :: FilePath -> FilePath -> IO ()Source
Copy a directory recursively. Moves every file, creates every directory.
replaceRoot :: FilePath -> FilePath -> FilePath -> FilePathSource
Given a root path, a new root path, and a path to be changed, removes the old root from the path and replaces it with to.
removeRoot :: FilePath -> FilePath -> FilePathSource
Given a root (prefix), remove it from a path. This is useful for getting the filename and subdirs of a path inside of a root.
We can use this data type to represent the pieces of a directory.