View source: R/snapshot_storage.R
| snapshot_storage | R Documentation |
Executes scan_storage() and stores the resulting observational dataset
as a timestamped .rds snapshot.
snapshot_storage(
root,
storage_id = "local-storage",
person_id = "user",
scan_time = Sys.time(),
label = NULL,
path = tempdir(),
compute_signature = TRUE,
max_signature_size = 200 * 1024 * 1024
)
root |
Character. Path to the root folder to scan. |
storage_id |
Character. Identifier of the storage. |
person_id |
Character. Identifier of the person. |
scan_time |
POSIXct. Timestamp of the scan. |
label |
Character. Optional human-readable label describing the scanned scope (e.g. "d_eviota"). |
path |
Character. Directory where snapshots are stored. |
compute_signature |
Logical. Whether to compute fast file signatures. |
max_signature_size |
Numeric. Maximum file size in bytes for signatures. |
Each snapshot captures the state of file instantiations at a specific point in time, preserving:
file-level metadata
structural context
globally contextualised file paths (storage_id::local_path)
optional content signatures
repository associations
Snapshots are intended as:
durable audit artefacts
inputs for longitudinal analysis
reproducible evidence of observed environments
Since schema version 0.1.3, snapshots store full_path
values as globally contextualised paths:
storage_id::local_filesystem_path
This prevents collisions between similar local folder structures observed on different machines or storage contexts.
Invisibly returns the path to the stored snapshot.
Invisibly returns the full path to the saved snapshot.
root <- tempfile()
dir.create(root)
dir.create(file.path(root, "R"))
dir.create(file.path(root, "data"))
file.create(file.path(root, "R", "a.R"))
file.create(file.path(root, "R", "b.R"))
file.create(file.path(root, "data", "c.csv"))
snapshot_storage(
root = root,
storage_id = "test-storage",
path = root
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.