cacheUrl: Download and cache a file

View source: R/cacheUrl.R

cacheUrlR Documentation

Download and cache a file

Description

Download and cache a file

Usage

cacheUrl(url, pkg = "pipette", update = FALSE, ask = FALSE, verbose = TRUE)

Arguments

url

character(1). Uniform Resource Locator (URL).

pkg

character(1). Package name.

update

logical(1). Call bfcneedsupdate internally to see if URL needs an update. Doesn't work reliably for all servers, so disabled by default.

ask

logical(1). Ask if package cache needs to be created or if file needs to be updated.

verbose

logical(1). Run the function with verbose output.

Details

Caching requires BiocFileCache and tools packages to be installed. If BiocFileCache is not installed, URL will be downloaded as a temporary file instead.

Value

character(1). Cached file path on disk.

Note

Updated 2023-09-28.

See Also

  • BiocFileCache::bfcinfo().

Examples

url <- AcidBase::pasteUrl(pipetteTestsUrl, "biocfilecache-test.txt")
file <- cacheUrl(url)
print(file)

acidgenomics/pipette documentation built on Jan. 31, 2024, 10:32 p.m.