download.file.wcheck: Download a remote file if it is new or updated

View source: R/loading.R

download.file.wcheckR Documentation

Download a remote file if it is new or updated

Description

Wraps regular download.file, but by default caches the the etag in the file header and then compares this before downloading again.

Usage

download.file.wcheck(
  url,
  destdir = NULL,
  destfile = NULL,
  overwrite = NULL,
  mode = "wb",
  ...
)

Arguments

url

Location of remote file to download

destdir

Path to local download directory

destfile

Full path to local downloaded file

overwrite

Whether to check etag (NULL) or only download if file is missing (FALSE) or always download (TRUE).

mode

See the download.file argument of the same name. Must be set to 'wb' on Windows to download binary files and therefore defaults to this value.

...

Additional arguments passed to download.file

Details

The header will be cached in a file called XXXX.http_header.rds next to the downloaded file.

When the URL is unreachable, a check is made to see if the corresponding file already exists locally. If yes, then a warning is issued, but that path is used. If no, then the function will error out.

The header will be cached in a file called XXXX.http_header.rds next to the downloaded file

Value

Path to downloaded (or cached) file.

See Also

download.file


jefferis/flycircuit documentation built on Feb. 4, 2023, 6:04 p.m.