hashDownload: Download and store hash value from downloaded file

Description Usage Arguments Value Author(s) Examples

Description

To avoid redownloading existing files, verify if the file exists locally. If the file exists, compare the checksum value to that logged by original download.

Usage

1
2
3
hashDownload(urls, destfile, checkhash = TRUE, quick = FALSE,
  dbHash = getOption("webdatabases.dbfile"), cascade = FALSE,
  quiet = TRUE)

Arguments

urls

A character string. Represents the url of file to be downloaded.

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.

cascade

Logical. If FALSE, file is untar and/or unzip. Default is FALSE.

quiet

Logical. If TRUE, suppress status messages (if any), and the progress bar.

Value

Invoked for its side-effect of downloading files to the destfile/ directory.

Author(s)

Melina Houle

Examples

1
2
3
4
5
## Not run: 
u <-"http://ftp.geogratis.gc.ca/pub/nrcan_rncan/archive/vector/cli_itc_50k/land_use/L040J03.zip"
hashDownload(urls = u, destfile = tempdir(), checkhash = FALSE, cascade = FALSE)

## End(Not run)

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