Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains higher-level functions for working with archives in Haskell. See Codec.Archive.Foreign for direct bindings to libarchive.
Synopsis
- unpackToDir :: FilePath -> ByteString -> IO ()
- unpackArchive :: FilePath -> FilePath -> IO ()
- entriesToFile :: Foldable t => FilePath -> t Entry -> IO ()
- entriesToFileZip :: Foldable t => FilePath -> t Entry -> IO ()
- entriesToFile7Zip :: Foldable t => FilePath -> t Entry -> IO ()
- entriesToBS :: Foldable t => t Entry -> ByteString
- entriesToBS7zip :: Foldable t => t Entry -> ByteString
- entriesToBSzip :: Foldable t => t Entry -> ByteString
- readArchiveFile :: FilePath -> IO [Entry]
- readArchiveBS :: ByteString -> [Entry]
- data Entry = Entry {
- filepath :: !FilePath
- content :: !EntryContent
- permissions :: !Permissions
- ownership :: !Ownership
- time :: !ModTime
- data EntryContent
- data Ownership = Ownership {}
- type Permissions = CMode
- type ModTime = (CTime, CLong)
- type Id = Int64
- standardPermissions :: Permissions
- executablePermissions :: Permissions
High-level functionality
:: FilePath | Directory to unpack in |
-> ByteString |
|
-> IO () |
This is more efficient than
unpackToDir "llvm" =<< BS.readFile "llvm.tar"
entriesToFile :: Foldable t => FilePath -> t Entry -> IO () Source #
Write some entries to a file, creating a tar archive. This is more efficient than
BS.writeFile "file.tar" (entriesToBS entries)
entriesToFileZip :: Foldable t => FilePath -> t Entry -> IO () Source #
Write some entries to a file, creating a zip archive.
entriesToFile7Zip :: Foldable t => FilePath -> t Entry -> IO () Source #
Write some entries to a file, creating a .7z
archive.
entriesToBS :: Foldable t => t Entry -> ByteString Source #
Returns a ByteString
containing a tar archive with the Entry
s
entriesToBS7zip :: Foldable t => t Entry -> ByteString Source #
Returns a ByteString
containing a .7z
archive with the Entry
s
entriesToBSzip :: Foldable t => t Entry -> ByteString Source #
Returns a ByteString
containing a zip archive with the Entry
s
readArchiveFile :: FilePath -> IO [Entry] Source #
Read an archive from a file. The format of the archive is automatically detected.
readArchiveBS :: ByteString -> [Entry] Source #
Read an archive contained in a ByteString
. The format of the archive is
automatically detected.
Concrete (Haskell) types
Entry | |
|
type Permissions = CMode Source #