This is a manual way of achieving prepInputs(..., purge = 7), useful in cases
where prepInputs is not called directly by the user, so it would be difficult
to set purge = 7.
purgeChecksums(checksumFile, fileToRemove)NULL. Run for its side effect, namely, and file removed from the CHECKSUMS.txt
file.
# Set up a small CHECKSUMS.txt-like file, then purge one entry
tf <- tempfile(fileext = ".txt")
data.table::fwrite(
data.table::data.table(file = c("a.tif", "b.tif"), checksum = c("x1", "x2")),
tf
)
purgeChecksums(tf, "a.tif")
data.table::fread(tf)
#> file checksum
#> <char> <char>
#> 1: b.tif x2
unlink(tf)