unison-cli-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

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.

Synopsis

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 -> FilePath Source #

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 -> FilePath Source #

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.

data Directory Source #

We can use this data type to represent the pieces of a directory.

Instances

Instances details
Show Directory Source # 
Instance details

Defined in System.Path

$sel:dirPath:Directory :: Directory -> FilePath Source #

The path of the directory itself.

$sel:subDirs:Directory :: Directory -> [FilePath] Source #

All subdirectories of this directory.

$sel:files:Directory :: Directory -> [FilePath] Source #

All files contained in this directory.

createDir :: FilePath -> IO Directory Source #

Creates a Directory instance from a FilePath.

filterUseless :: [FilePath] -> [FilePath] Source #

Remove useless paths from a list of paths.