saveFileSum: Create a checksum file

View source: R/fileUtils.R

saveFileSumR Documentation

Create a checksum file

Description

Calculates a checksum for a file and saves it to file that by default is named the same, except with an appended extension matching the algorithm.

Usage

saveFileSum(
  file,
  algo = c("md5", "sha1", "crc32", "sha256", "sha512"),
  checkFile = NULL,
  show = FALSE,
  overwrite = FALSE
)

Arguments

file

The file to validate

algo

The checksum algorithm to use (see digest::digest()).

checkFile

The name of the checksum file to create. By default named the same as file, with an additional extension matching algo, e.g. for an md5 checkFile for file.txt, the default would be file.txt.md5. If this filename includes a directory component, it will be created if needed.

show

Should the checkFiles be visible (i.e. NOT start with a ".")? This is ignored if the checkFile is specified. Note, if the file is hidden, then its default checksum file will be hidden regardless of this setting.

overwrite

If the checkFile already exists and does not match, it is an error unless this is set TRUE, in which case the file is just overwritten. If it matches, then done (in this case modify timestamps will not be changed).

Value

The generated checkFile


jefferys/JefferysRUtils documentation built on June 18, 2024, 4:39 a.m.