file-collection-0.1.0.2: Provide a uniform interface over file archives and directories

Safe HaskellNone
LanguageHaskell2010

Codec.Archive.FileCollection

Documentation

class FileCollection d where Source

Methods

createDirectory :: d -> FilePath -> IO d Source

createDirectory root path creates a new directory root/path which | is initially empty. The path to the new directory is returned.

createDirectoryIfMissing :: d -> FilePath -> IO d Source

createDirectoryIfMissing root path creates a new directory root/path | if it doesn't exist. It also creates any missing ancestors of path

removeDirectory :: d -> FilePath -> IO d Source

removeDirectory root dir removes an existing directory dir.

removeDirectoryRecursive :: d -> FilePath -> IO d Source

removeDirectoryRecursive root dir removes a directory dir and all | its contents and subdirectories.

renameDirectory :: d -> FilePath -> FilePath -> IO d Source

renameDirectory root source target changes the name of an existing | directory from source to target. If the target directory already | exists, it can be removed or merged with the source directory.

getDirectoryContents :: d -> FilePath -> IO [FilePath] Source

getDirectoryContents root dir returns a list of all entries | immediately contained in dir.

removeFile :: d -> FilePath -> IO d Source

removeFile root file removes the directory entry for an existing file, | where file is not a directory.

renameFile :: d -> FilePath -> FilePath -> IO d Source

renameFile root old new changes the name of an existing file from old | to new. If the new object already exists, it is replaced by old.

copyFile :: d -> FilePath -> FilePath -> IO d Source

copyFile root old new creates a duplicate of old with the name new.

findFile :: d -> [FilePath] -> String -> IO (Maybe FilePath) Source

findFile root dirs file returns the path of file if it can be found | in any of dirs.

findFiles :: d -> [FilePath] -> String -> IO [FilePath] Source

doesFileExist :: d -> FilePath -> IO Bool Source

doesFileExist root path returns True if path exists and is not a | directory.

doesDirectoryExist :: d -> FilePath -> IO Bool Source

doesDirectoryExist root path returns True if /path exists and is a | directory.