Verify (and optionally write) checksums.
Checksums are computed using .digest, which is simply a
wrapper around digest::digest.
Checksums(path, write, quickCheck = FALSE, checksumFile = file.path(path, "CHECKSUMS.txt"), files = NULL, ...) # S4 method for character,logical Checksums(path, write, quickCheck = FALSE, checksumFile = file.path(path, "CHECKSUMS.txt"), files = NULL, ...) # S4 method for character,missing Checksums(path, write, quickCheck = FALSE, checksumFile = file.path(path, "CHECKSUMS.txt"), files = NULL, ...)
| path | Character string giving the path to the module directory. |
|---|---|
| write | Logical indicating whether to overwrite |
| quickCheck | Logical. If |
| checksumFile | The filename of the checksums file to read or write to.
The default is |
| files | An optional character string or vector of specific files to checksum.
This may be very important if there are many files listed in a
|
| ... | Passed to |
A data.table with columns: result, expectedFile,
actualFile, checksum.x, checksum.y,
algorithm.x, algorithm.y, filesize.x, filesize.y
indicating the result of comparison between local file (x) and
expectation based on the CHECKSUMS.txt file.
In version 1.2.0 and earlier, two checksums per file were required
because of differences in the checksum hash values on Windows and Unix-like
platforms. Recent versions use a different (faster) algorithm and only require
one checksum value per file.
To update your CHECKSUMS.txt files using the new algorithm, see
https://github.com/PredictiveEcology/SpaDES/issues/295#issuecomment-246513405.
# NOT RUN { moduleName <- "my_module" modulePath <- file.path("path", "to", "modules") ## verify checksums of all data files Checksums(moduleName, modulePath) ## write new CHECKSUMS.txt file # 1. verify that all data files are present (and no extra files are present) list.files(file.path(modulePath, moduleName, "data")) # 2. calculate file checksums and write to file (this will overwrite CHECKSUMS.txt) Checksums(moduleName, modulePath, write = TRUE) # }