Skip to contents

Downloads a capture's bytes and checks their SHA-256: against the archive's record, and against sha256 when you give one (the pin from your analysis). A file that does not match is deleted.

Usage

arcget(x, dest, sha256 = NULL, at = NULL, tmout = 600L)

Arguments

x

A capture id ("20261021133005-1a2b3c4d", from arcfind or a capture page) or a web address; for an address, the capture closest to at (default: the latest) is taken.

dest

The file the fetched bytes are written to.

sha256

Optional SHA-256 the bytes must have.

at

For an address, the time to be closest to, "YYYY..." up to 14 digits (UTC).

tmout

Seconds allowed for the download.

Value

dest, invisibly, with attributes capture_id, url, captured and sha256.

See also

arcfind, fetchvrf (which falls back to the archive on its own).

Examples

if (FALSE) { # interactive()
src <- "https://www150.statcan.gc.ca/n1/tbl/csv/35100177-eng.zip"
f <- arcget(src, tempfile(fileext = ".zip"))
attr(f, "sha256")
}