| Title: | File Storage |
|---|---|
| Description: | Store files by content, similar in spirit to the 'storr' package (into which this might get folded). |
| Authors: | Rich FitzJohn [aut, cre], Imperial College of Science, Technology and Medicine [cph] |
| Maintainer: | Rich FitzJohn <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-06-11 09:52:35 UTC |
| Source: | https://github.com/reside-ic/fstorr |
Create an fstorr object - a place to store data by content
based on a global key.
fstorr(root, get_resource, hash_content = NULL)fstorr(root, get_resource, hash_content = NULL)
root |
Root to store files in - a path to a directory. If it exists it must be a directory and you should treat the contents as opaque. |
get_resource |
A function that gets a resource. It must take as its argument a key, and it must return a raw vector (character vectors are not supported on return because they are complicated for thinking about line-endings and hashes). |
hash_content |
A function that hashes a resource. If not
given then |
A fstorr object
Rich Fitzjohn
path <- tempfile() obj <- fstorr::fstorr(path, charToRaw) obj$list() obj$get("a")path <- tempfile() obj <- fstorr::fstorr(path, charToRaw) obj$list() obj$get("a")