download_files_with_md5_mismatch: Download files marked as mismatch to package cache.

View source: R/filecache.R

download_files_with_md5_mismatchR Documentation

Download files marked as mismatch to package cache.

Description

Download files marked as mismatched to package cache. You should check afterwards whether this was successful, e.g., via 'files_exist_md5'.

Usage

download_files_with_md5_mismatch(
  local_files_absolute,
  local_files_md5_ok,
  urls,
  files_are_binary = NULL,
  num_connections = getOption("pkgfilecache.num_connections", 2)
)

Arguments

local_files_absolute

vector of strings. A vector of filenames, must already include the package cache part.

local_files_md5_ok

logical vector. For each file, whether the local copy is OK. Only files for which this lists FALSE will be downloaded.

urls

vector of strings. For each file, a remote URL where to download the file. Will be passed to 'curl::curl_download', see that function for URL encoding details.

files_are_binary

logical vector. For each file, whether it is binary. Only required on Windows, when files need to be downloaded. See 'curl::curl_download' docs for details.

num_connections

integer. The number of parallel connections to use when downloading files. Defaults to 2, or to the value of the R option pkgfilecache.num_connections if it is set. Use 1 for strictly sequential downloads.

Value

Named character vector with one entry per file in local_files_absolute (the names are the absolute file paths). The entry is NA for files that were not downloaded in this call and for files that downloaded successfully; for files that were downloaded but failed it contains the error message of the download attempt. This message can distinguish remote problems (e.g., an HTTP status code like 404, or a connection failure) from local problems (e.g., the local file could not be written). The authoritative success check is done separately via files_exist_md5 afterwards.


pkgfilecache documentation built on Sept. 1, 2026, 1:08 a.m.