A module for performing operations on directories.
- chdir :: FilePath -> IO a -> IO a
- archiveDirectories :: [(FilePath, FilePath)] -> RecursePredicate -> FilterPredicate -> [ZipOption] -> IO Archive
- writeArchive :: [(FilePath, FilePath)] -> RecursePredicate -> FilterPredicate -> [ZipOption] -> FilePath -> IO ()
- writeHashArchive :: [(FilePath, FilePath)] -> RecursePredicate -> FilterPredicate -> [ZipOption] -> FilePath -> IO ()
- copyDir :: RecursePredicate -> FilterPredicate -> Int -> FilePath -> FilePath -> IO ()
- dropRoot :: FilePath -> String
- dropRoot' :: Int -> FilePath -> FilePath
- mkdir :: FilePath -> IO ()
- rmdir :: FilePath -> IO ()
- copyFiles :: RecursePredicate -> FilterPredicate -> FilePath -> FilePath -> IO ()
Documentation
:: FilePath | The directory to change to. |
-> IO a | The action to execute in the given directory. |
-> IO a | The result of executing the given action. |
Change to the given directory, then execute the given action, then change back to the original directory.
:: [(FilePath, FilePath)] | A list of base directories to change to and contents of that directory to archive. |
-> RecursePredicate | The recursion predicate to search for files to archive. |
-> FilterPredicate | The filter predicate to search for files to archive. |
-> [ZipOption] | The options during the creation of the archive. |
-> IO Archive | The constructed archive. |
Create a zip archive by changing into directories and archiving the contents.
:: [(FilePath, FilePath)] | A list of base directories to change to and contents of that directory to archive. |
-> RecursePredicate | The recursion predicate to search for files to archive. |
-> FilterPredicate | The filter predicate to search for files to archive. |
-> [ZipOption] | The options during the creation of the archive. |
-> FilePath | The file to write the archive to. |
-> IO () |
Writes a zip archive to a file.
:: [(FilePath, FilePath)] | A list of base directories to change to and contents of that directory to archive. |
-> RecursePredicate | The recursion predicate to search for files to archive. |
-> FilterPredicate | The filter predicate to search for files to archive. |
-> [ZipOption] | The options during the creation of the archive. |
-> FilePath | The file to write the archive to and the prefix name of the files containing the hashes. |
-> IO () |
:: RecursePredicate | The recursion predicate to search for files in the source directory. |
-> FilterPredicate | The filter predicate to search for files in the source directory. |
-> Int | The number of parent directories to drop before copying to the target directory. |
-> FilePath | The source directory. |
-> FilePath | The target directory. |
-> IO () |
Copy the contents of a directory to another, perhaps trimming parent directories.
:: FilePath | The file path to drop the parent directory from. |
-> String | The file path without a parent directory. |
Drops the parent directory of a given file path.
dropRoot "/foo/bar" == "/bar" dropRoot "foo/bar" == "bar" dropRoot "foo" == "" dropRoot "" == ""
:: Int | The number of times to drop the parent directory. |
-> FilePath | The file path to drop parent directories from. |
-> FilePath | Te file path without parent directories. |
Drops the parent directory (dropRoot
) of a given file path multiple times.
dropRoot' 0 "/foo/bar" == "/foo/bar" dropRoot' 1 "/foo/bar" == "/bar" dropRoot' 1 "foo/bar" == "bar" dropRoot' 2 "foo/bar" == "" dropRoot' 10 "foo/bar" == ""
Creates the given directory and its parents if it doesn't exist.
Removes the given directory recursively if it exists.
:: RecursePredicate | The recursion predicate to search for files to copy. |
-> FilterPredicate | The filter predicate to search for files to copy. |
-> FilePath | The directory to copy from. |
-> FilePath | The directory to copy to. |
-> IO () |
Copies files from one directory to another directory.