Safe Haskell | None |
---|---|
Language | Haskell2010 |
IO actions that might be put in a package at some point.
- getWorkingDir :: MonadIO m => m (Path Abs Dir)
- parseRelAsAbsDir :: (MonadThrow m, MonadIO m) => FilePath -> m (Path Abs Dir)
- parseRelAsAbsFile :: (MonadThrow m, MonadIO m) => FilePath -> m (Path Abs File)
- listDirectory :: (MonadIO m, MonadThrow m) => Path Abs Dir -> m ([Path Abs Dir], [Path Abs File])
- resolveDir :: (MonadIO m, MonadThrow m) => Path Abs Dir -> FilePath -> m (Path Abs Dir)
- resolveFile :: (MonadIO m, MonadThrow m) => Path Abs Dir -> FilePath -> m (Path Abs File)
- resolveDirMaybe :: (MonadIO m, MonadThrow m) => Path Abs Dir -> FilePath -> m (Maybe (Path Abs Dir))
- resolveFileMaybe :: (MonadIO m, MonadThrow m) => Path Abs Dir -> FilePath -> m (Maybe (Path Abs File))
- data ResolveException
- removeFile :: MonadIO m => Path b File -> m ()
- removeFileIfExists :: MonadIO m => Path b File -> m ()
- removeTree :: MonadIO m => Path b Dir -> m ()
- removeTreeIfExists :: MonadIO m => Path b Dir -> m ()
- renameFile :: MonadIO m => Path b1 File -> Path b2 File -> m ()
- renameFileIfExists :: MonadIO m => Path b1 File -> Path b2 File -> m ()
- renameDir :: MonadIO m => Path b1 Dir -> Path b2 Dir -> m ()
- renameDirIfExists :: MonadIO m => Path b1 Dir -> Path b2 Dir -> m ()
- moveFile :: MonadIO m => Path b1 File -> Path b2 Dir -> m ()
- moveFileIfExists :: MonadIO m => Path b1 File -> Path b2 Dir -> m ()
- moveDir :: MonadIO m => Path b1 Dir -> Path b2 Dir -> m ()
- moveDirIfExists :: MonadIO m => Path b1 Dir -> Path b2 Dir -> m ()
- fileExists :: MonadIO m => Path b File -> m Bool
- dirExists :: MonadIO m => Path b Dir -> m Bool
- copyFile :: MonadIO m => Path b1 File -> Path b2 File -> m ()
- copyFileIfExists :: MonadIO m => Path b1 File -> Path b2 File -> m ()
- copyDirectoryRecursive :: (MonadIO m, MonadThrow m) => Path Abs Dir -> Path Abs Dir -> m ()
- createTree :: MonadIO m => Path b Dir -> m ()
- dropRoot :: Path Abs t -> Path Rel t
- parseCollapsedAbsFile :: MonadThrow m => FilePath -> m (Path Abs File)
- parseCollapsedAbsDir :: MonadThrow m => FilePath -> m (Path Abs Dir)
Documentation
parseRelAsAbsDir :: (MonadThrow m, MonadIO m) => FilePath -> m (Path Abs Dir) Source
Parse a directory path. If it's relative, then the absolute version is yielded, based off the working directory.
parseRelAsAbsFile :: (MonadThrow m, MonadIO m) => FilePath -> m (Path Abs File) Source
Parse a file path. If it's relative, then the absolute version is yielded, based off the working directory.
listDirectory :: (MonadIO m, MonadThrow m) => Path Abs Dir -> m ([Path Abs Dir], [Path Abs File]) Source
List objects in a directory, excluding ".
" and "..
". Entries are not sorted.
resolveDir :: (MonadIO m, MonadThrow m) => Path Abs Dir -> FilePath -> m (Path Abs Dir) Source
Appends a stringly-typed relative path to an absolute path, and then canonicalizes it.
resolveFile :: (MonadIO m, MonadThrow m) => Path Abs Dir -> FilePath -> m (Path Abs File) Source
Appends a stringly-typed relative path to an absolute path, and then canonicalizes it.
resolveDirMaybe :: (MonadIO m, MonadThrow m) => Path Abs Dir -> FilePath -> m (Maybe (Path Abs Dir)) Source
Appends a stringly-typed relative path to an absolute path, and then
canonicalizes it. If the path doesn't exist (and therefore cannot
be canonicalized, Nothing
is returned).
resolveFileMaybe :: (MonadIO m, MonadThrow m) => Path Abs Dir -> FilePath -> m (Maybe (Path Abs File)) Source
Appends a stringly-typed relative path to an absolute path, and then
canonicalizes it. If the path doesn't exist (and therefore cannot
be canonicalized, Nothing
is returned).
data ResolveException Source
removeFile :: MonadIO m => Path b File -> m () Source
Remove a file. Bails out if it doesn't exist.
removeFileIfExists :: MonadIO m => Path b File -> m () Source
Remove a file. Optimistically assumes it exists. If it doesn't, doesn't complain.
removeTree :: MonadIO m => Path b Dir -> m () Source
Remove a tree. Bails out if it doesn't exist.
removeTreeIfExists :: MonadIO m => Path b Dir -> m () Source
Remove tree, don't complain about non-existent directories.
renameFile :: MonadIO m => Path b1 File -> Path b2 File -> m () Source
Rename a file. Bails out if it doesn't exist.
renameFileIfExists :: MonadIO m => Path b1 File -> Path b2 File -> m () Source
Rename a file. Optimistically assumes it exists. If it doesn't, doesn't complain.
renameDirIfExists :: MonadIO m => Path b1 Dir -> Path b2 Dir -> m () Source
Rename a directory. Optimistically assumes it exists. If it doesn't, doesn't complain.
moveFile :: MonadIO m => Path b1 File -> Path b2 Dir -> m () Source
Move a file. Bails out if it doesn't exist.
moveFileIfExists :: MonadIO m => Path b1 File -> Path b2 Dir -> m () Source
Move a file. Optimistically assumes it exists. If it doesn't, doesn't complain.
moveDir :: MonadIO m => Path b1 Dir -> Path b2 Dir -> m () Source
Move a dir. Bails out if it doesn't exist.
moveDirIfExists :: MonadIO m => Path b1 Dir -> Path b2 Dir -> m () Source
Move a dir. Optimistically assumes it exists. If it doesn't, doesn't complain.
copyFile :: MonadIO m => Path b1 File -> Path b2 File -> m () Source
Copies a file to another path. Bails out if it doesn't exist.
copyFileIfExists :: MonadIO m => Path b1 File -> Path b2 File -> m () Source
Copies a file to another path. Optimistically assumes it exists. If it doesn't, doesn't complain.
:: (MonadIO m, MonadThrow m) | |
=> Path Abs Dir | Source directory |
-> Path Abs Dir | Destination directory |
-> m () |
Copy a directory recursively. This just uses copyFile
, so it is not smart about symbolic
links or other special files.
createTree :: MonadIO m => Path b Dir -> m () Source
Make a directory tree, creating parents if needed.
dropRoot :: Path Abs t -> Path Rel t Source
Drop the root (either /
on POSIX or C:\
, D:\
, etc. on
Windows).
parseCollapsedAbsFile :: MonadThrow m => FilePath -> m (Path Abs File) Source
Collapse intermediate "." and ".." directories from path, then parse
it with parseAbsFile
.
(probably should be moved to the Path module)
parseCollapsedAbsDir :: MonadThrow m => FilePath -> m (Path Abs Dir) Source
Collapse intermediate "." and ".." directories from path, then parse
it with parseAbsDir
.
(probably should be moved to the Path module)