hashUntar: Extract files from a tar archive and log checksum value to...

Description Usage Arguments Value Author(s) Examples

Description

Prior to untar, the function check if untar was previously performed (untarred file exist locally) and compare checksum value from previous event when present. Untar is performed when file doesn't exists or checksums don't match.

Usage

1
2
hashUntar(tarfile, destfile, checkhash = TRUE, quick = FALSE,
  dbHash = getOption("webdatabases.dbfile"))

Arguments

tarfile

A character string. Represents path to tarfile.

destfile

A character string. Represents the name where resulting file is saved.

checkhash

Logical. If TRUE (default), check if file exists locally and cross-check the file's checksum value with that logged from a previous event, skippng redownload if checksum matches. When checksums don't match or file doesn't exist locally, the file is downloaded and its checksum computed. If FALSE, the function is executed even if the file is found locally.

quick

Logical. If TRUE, checksum is compiled using the combination of the filename and its size. If FALSE (default), cheksum is compiled using the object.

dbHash

Character string. The path to the database file where checksum value of file is logged. If the database does not yet exist, one is created. Default is to use the option webdatabases.dbfile.

Value

Untarred/unzipped tarfile in a subfolder under destfile using basename{tarfile} name.

Author(s)

Melina Houle

Examples

1
2
3
4
5
6
urlpath <- "ftp://sidads.colorado.edu/pub/DATASETS/NOAA/G02171/Hudson_Bay/2006"
urlfile <-  "cis_SGRDRHB_20060904_pl_a.tar"
url <- file.path(urlpath, urlfile)
hashDownload(url, destfile = tempdir(), cascade = FALSE)
tar<- file.path(tempdir(), basename(url))
hashUntar(tar, tempdir(), checkhash= FALSE)

PredictiveEcology/webDatabases documentation built on May 8, 2019, 3:09 p.m.