Skip to contents

This function copies a remote file to a local cache once and makes sure it is reused.

Usage

.cache_download(
  url,
  ...,
  .nocache = getOption("cache.disable", default = FALSE),
  .cache = getOption("cache.download", rappdirs::user_cache_dir(utils::packageName())),
  .stale = Inf,
  .extn = NULL
)

Arguments

url

the url to download

...

ignored

.nocache

if set to TRUE all caching is disabled

.cache

the location of the downloaded files

.stale

how long to leave this file before replacing it.

.extn

the file name extension

Value

the path to the downloaded file