hashUnzip: Extract files from a zip archive downloaded and log checksum...

Description Usage Arguments Value Author(s) Examples

Description

Unzip dataset previously downloaded from url, first checking if unzip was previously performed (unzip file exists locally).

Usage

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

Arguments

zipfile

A character vector. Contains path to zipfile.

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

Invoked for its side-effect of saving unzipped file in a subdirectory using the zipfile basename in the ‘destfile/’ directory.

Author(s)

Melina Houle

Examples

1
2
3
4
u <-"http://ftp.geogratis.gc.ca/pub/nrcan_rncan/archive/vector/cli_itc_50k/land_use/L040J03.zip"
hashDownload(u, destfile = tempdir(), checkhash= FALSE, cascade = FALSE)
zip <- file.path(tempdir(), basename(u))
hashUnzip(zip, tempdir(), checkhash = FALSE)

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