Skip to contents

Saves disk space after the parser has succeeded. Returns silently if nothing to do (no raw.owner/ directory) or if the archive already exists. Only deletes raw.owner/ after the tar archive is verified (re-readable). On any failure, leaves both intact.

Usage

archiveRawOwner(path)

Arguments

path

Absolute path to the station folder containing raw.owner/.

Value

Logical, TRUE if archive newly written, FALSE if no-op, NA on failure.

Examples

station <- file.path(tempdir(), "gmsp-archive-example")
unlink(station, recursive = TRUE)
dir.create(file.path(station, "raw.owner"), recursive = TRUE)
writeLines("provider bytes", file.path(station, "raw.owner", "record.txt"))
archiveRawOwner(station)
file.exists(file.path(station, "raw.owner.tar.gz"))
#> [1] TRUE