Lastik-0.1: A library for compiling programs in a variety of languagesSource codeContentsIndex
Lastik.Directory
Description
A module for performing operations on directories.
Synopsis
chdir :: FilePath -> IO a -> IO a
archiveDirectories :: [(FilePath, FilePath)] -> RecursionPredicate -> FilterPredicate -> [ZipOption] -> IO Archive
writeArchive :: [(FilePath, FilePath)] -> RecursionPredicate -> FilterPredicate -> [ZipOption] -> FilePath -> IO ()
copyDir :: RecursionPredicate -> FilterPredicate -> Int -> FilePath -> FilePath -> IO ()
dropRoot :: FilePath -> String
dropRoot' :: Int -> FilePath -> FilePath
mkdir :: FilePath -> IO ()
rmdir :: FilePath -> IO ()
Documentation
chdirSource
::
=> FilePathThe action to execute in the given directory.
-> IO aThe result of executing the given action.
-> IO a
Change to the given directory, then execute the given action, then change back to the original directory.
archiveDirectoriesSource
:: [(FilePath, FilePath)]A list of base directory to change to and contents of that directory to archive.
-> RecursionPredicateThe recursion predicate to search for files to archive.
-> FilterPredicateThe filter predicate to search for files to archive.
-> [ZipOption]The options during the creation of the archive.
-> IO ArchiveThe constructed archive.
Create a zip archive by changing into directories and archiving the contents.
writeArchiveSource
:: [(FilePath, FilePath)]A list of base directory to change to and contents of that directory to archive.
-> RecursionPredicateThe recursion predicate to search for files to archive.
-> FilterPredicateThe filter predicate to search for files to archive.
-> [ZipOption]The options during the creation of the archive.
-> FilePathThe file to write the archive to.
-> IO ()
Writes a zip archive to a file.
copyDirSource
:: RecursionPredicateThe recursion predicate to search for files in the source directory.
-> FilterPredicateThe filter predicate to search for files in the source directory.
-> IntThe number of parent directories to drop before copying to the target directory.
-> FilePathThe source directory.
-> FilePathThe target directory.
-> IO ()
Copy the contents of a directory to another, perhaps trimming parent directories.
dropRootSource
:: FilePathThe file path to drop the parent directory from.
-> StringThe 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 "" == ""
dropRoot'Source
:: IntThe number of times to drop the parent directory.
-> FilePathThe file path to drop parent directories from.
-> FilePathTe 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" == ""
mkdirSource
:: FilePathThe directory to create.
-> IO ()
Creates the given directory and its parents if it doesn't exist.
rmdirSource
:: FilePathThe directory to remove.
-> IO ()
Removes the given directory recursively if it exists.
Produced by Haddock version 2.6.0