dirtree-0.1.2: A small library for working with directories.

Copyright(c) Christian Gram Kalhauge 2019
LicenseMIT
Maintainerkalhauge@cs.ucla.edu
Safe HaskellNone
LanguageHaskell2010

System.DirTree.Zip

Contents

Description

Enables reading and writeing zipfiles using dirtrees. It is not a complete 1-1 mapping but for many usecases it gets the job done.

It is based of the `zip-archive` library, which can be used if more control is needed.

Synopsis

Documentation

entriesFromDirForest :: Integer -> RelativeDirForest Link ByteString -> [Entry] Source #

Create a list of enties from a FileMap.

Helpers

entryToDirForest :: Entry -> Maybe (DirForest Entry) Source #

Convert a entry to a single filemap, fails if the entry path is empty.

entryFromFile :: Integer -> FileKey -> RelativeFile Link ByteString -> Entry Source #

Create a single entry from a file. This also handles symlinks, but changes saves all files with the stdFileMode.

files :: Lens' Archive (RelativeDirForest Link ByteString) Source #

A lens to get and set the files of an archive. Uses sparingly on big archvies as it will convert forth and back.

entries :: Lens' Archive [Entry] Source #

A simple lens into the entries of an archive.

Re-Exports

toArchive :: ByteString -> Archive #

Reads an Archive structure from a raw zip archive (in a lazy bytestring).

fromArchive :: Archive -> ByteString #

Writes an Archive structure to a raw zip archive (in a lazy bytestring).