checkFileSum | R Documentation |
Validates a file using a specified checksum algorithm against a file that
contains just the expected checksum result. By default looks for a file
in parallel to the file tested, except with an additional extension matching
the checksum algorithm. Can specify what to do after testing match through
use of the as=
argument. Supports returning TRUE/FALSE, a string message,
or signaling a message via stop()
, warning()
, or message()
. To support
testing without throwing errors, any errors such as missing file are reported
the same as an error triggered by a mismatched checksum, except it causes NA
to be returned with as=test
.
checkFileSum(
file,
algo = c("md5", "sha1", "crc32", "sha256", "sha512"),
checkFile = NULL,
as = c("test", "check", "error", "warning", "message", "stop")
)
file |
The file to validate |
algo |
The checksum algorithm to use (see |
checkFile |
The name of the file holding the expected checksum value.
If |
as |
How the results of the checksum test are reported. |
Depends on as=
. With matching checksums, will either be TRUE or the
empty string "
(possibly silently). If checksums don't match, it will
either be FALSE, a string giving the files and their mismatched checksums
(possibly silently), or an error will be triggered. If there is a problem
calculating the checksums, e.g. a file does not exits, the result will
either be "NA", a string describing the problem, or an error will be
triggered.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.