Storage.Hashed.Plain
Description
The plain format implementation resides in this module. The plain format does not use any hashing and basically just wraps a normal filesystem tree in the hashed-storage API.
NB. The read function on Blobs coming from a plain tree is susceptible to
file content changes. Since we use mmap in read, this will break
referential transparency and produce unexpected results. Please always make
sure that all parallel access to the underlying filesystem tree never
mutates files. Unlink + recreate is fine though (in other words, the
writePlainTree and plainTreeIO implemented in this module are safe in
this respect).
Documentation
writePlainTree :: Tree IO -> FilePath -> IO ()Source
Write out full tree to a plain directory structure. If you instead want to make incremental updates, refer to Storage.Hashed.Monad.