R Under development (unstable) (2024-01-23 r85822 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > source("incl/start.R") Loading required package: R.oo Loading required package: R.methodsS3 R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help. R.oo v1.26.0 successfully loaded. See ?R.oo for help. Attaching package: 'R.oo' The following object is masked from 'package:R.methodsS3': throw The following objects are masked from 'package:methods': getClasses, getMethods The following objects are masked from 'package:base': attach, detach, load, save R.filesets v2.15.1 successfully loaded. See ?R.filesets for help. Attaching package: 'R.filesets' The following objects are masked from 'package:base': append, readLines > > message("*** ChecksumFile / ChecksumFileSet") *** ChecksumFile / ChecksumFileSet > > ## Empty / missing > dfZ <- ChecksumFile() > print(dfZ) ChecksumFile: Name: NA Full name: NA Pathname: NA File size: NA Checksum on record: NA (checksum file missing) > > dfZ <- ChecksumFile(NA_character_) > print(dfZ) ChecksumFile: Name: NA Full name: NA Pathname: NA File size: NA Checksum on record: NA (checksum file missing) > > > ## Example files > path <- system.file("exData", "dataSetA,original", package="R.filesets") > print(path) [1] "D:/RCompile/CRANincoming/R-devel/lib/R.filesets/exData/dataSetA,original" > > ## Setting up a file set > ds <- GenericDataFileSet$byPath(path) > print(ds) GenericDataFileSet: Name: dataSetA Tags: original Full name: dataSetA,original Number of files: 11 Names: 1.2(a), 11.2(a), all, ..., fileFF [11] Path (to the first file): ../../lib/R.filesets/exData/dataSetA,original Total file size: 1.90 KiB (1945 bytes) > > ## Create copy (so that we can write checksum files) > pathT <- tempdir() > dsC <- copyTo(ds, path=pathT, overwrite=TRUE) > print(dsC) GenericDataFileSet: Name: RtmpQ9Zo4o Tags: Full name: RtmpQ9Zo4o Number of files: 11 Names: 1.2(a), 11.2(a), all, ..., fileFF [11] Path (to the first file): ../../../../../temp/RtmpQ9Zo4o Total file size: 1.90 KiB (1945 bytes) > > ## Checksum set > dsCZ <- getChecksumFileSet(dsC) > print(dsCZ) ChecksumFileSet: Name: RtmpQ9Zo4o Tags: Full name: RtmpQ9Zo4o Number of files: 11 Names: 1.2(a).txt, 11.2(a).txt, all, ..., fileFF.txt [11] Path (to the first file): ../../../../../temp/RtmpQ9Zo4o Total file size: 352 B (352 bytes) > > validate(dsCZ, verbose=TRUE) Validating checksum... Checksum already on file: 932b17dafa6774b5a36fd71420ffe706 Generating checksum for main file... Main file: ../../../../../temp/RtmpQ9Zo4o/1.2(a).txt Checksum for main file: 932b17dafa6774b5a36fd71420ffe706 Generating checksum for main file...done Comparing... Comparing...done Validating checksum...done Validating checksum... Checksum already on file: 932b17dafa6774b5a36fd71420ffe706 Generating checksum for main file... Main file: ../../../../../temp/RtmpQ9Zo4o/11.2(a).txt Checksum for main file: 932b17dafa6774b5a36fd71420ffe706 Generating checksum for main file...done Comparing... Comparing...done Validating checksum...done Validating checksum... Checksum already on file: 17176b5f957547d1b23da36fedead87a Generating checksum for main file... Main file: ../../../../../temp/RtmpQ9Zo4o/all,fullnames.txt Checksum for main file: 17176b5f957547d1b23da36fedead87a Generating checksum for main file...done Comparing... Comparing...done Validating checksum...done Validating checksum... Checksum already on file: fcb889d29d51c600409d242e03d7d779 Generating checksum for main file... Main file: ../../../../../temp/RtmpQ9Zo4o/fileA,20100112.dat Checksum for main file: fcb889d29d51c600409d242e03d7d779 Generating checksum for main file...done Comparing... Comparing...done Validating checksum...done Validating checksum... Checksum already on file: bd28bad7efebce6239e616639742ef4f Generating checksum for main file... Main file: ../../../../../temp/RtmpQ9Zo4o/fileA,20130116.datx Checksum for main file: bd28bad7efebce6239e616639742ef4f Generating checksum for main file...done Comparing... Comparing...done Validating checksum...done Validating checksum... Checksum already on file: e0e0d2750626df38cedab8796cfa6459 Generating checksum for main file... Main file: ../../../../../temp/RtmpQ9Zo4o/fileB,other,tags.dat Checksum for main file: e0e0d2750626df38cedab8796cfa6459 Generating checksum for main file...done Comparing... Comparing...done Validating checksum...done Validating checksum... Checksum already on file: b41a700ddec7da6c0ae79ed8b77f7421 Generating checksum for main file... Main file: ../../../../../temp/RtmpQ9Zo4o/fileC,inverted.dat Checksum for main file: b41a700ddec7da6c0ae79ed8b77f7421 Generating checksum for main file...done Comparing... Comparing...done Validating checksum...done Validating checksum... Checksum already on file: aff579b87779ce432d5b99568019cf37 Generating checksum for main file... Main file: ../../../../../temp/RtmpQ9Zo4o/fileD,3cols.dat Checksum for main file: aff579b87779ce432d5b99568019cf37 Generating checksum for main file...done Comparing... Comparing...done Validating checksum...done Validating checksum... Checksum already on file: 5b4897ffe01d08c8777a3867ae43244d Generating checksum for main file... Main file: ../../../../../temp/RtmpQ9Zo4o/fileE,headerArgs.dat Checksum for main file: 5b4897ffe01d08c8777a3867ae43244d Generating checksum for main file...done Comparing... Comparing...done Validating checksum...done Validating checksum... Checksum already on file: 932b17dafa6774b5a36fd71420ffe706 Generating checksum for main file... Main file: ../../../../../temp/RtmpQ9Zo4o/fileF.txt Checksum for main file: 932b17dafa6774b5a36fd71420ffe706 Generating checksum for main file...done Comparing... Comparing...done Validating checksum...done Validating checksum... Checksum already on file: 932b17dafa6774b5a36fd71420ffe706 Generating checksum for main file... Main file: ../../../../../temp/RtmpQ9Zo4o/fileFF.txt Checksum for main file: 932b17dafa6774b5a36fd71420ffe706 Generating checksum for main file...done Comparing... Comparing...done Validating checksum...done > > print(readChecksums(dsCZ)) 1.2(a).txt 11.2(a).txt "932b17dafa6774b5a36fd71420ffe706" "932b17dafa6774b5a36fd71420ffe706" all,fullnames.txt fileA,20100112.dat "17176b5f957547d1b23da36fedead87a" "fcb889d29d51c600409d242e03d7d779" fileA,20130116.datx fileB,other,tags.dat "bd28bad7efebce6239e616639742ef4f" "e0e0d2750626df38cedab8796cfa6459" fileC,inverted.dat fileD,3cols.dat "b41a700ddec7da6c0ae79ed8b77f7421" "aff579b87779ce432d5b99568019cf37" fileE,headerArgs.dat fileF.txt "5b4897ffe01d08c8777a3867ae43244d" "932b17dafa6774b5a36fd71420ffe706" fileFF.txt "932b17dafa6774b5a36fd71420ffe706" > > ## Single checksum file > dfC <- dsC[[1]] > print(dfC) GenericDataFile: Name: 1.2(a) Tags: Full name: 1.2(a) Pathname: D:/temp/RtmpQ9Zo4o/1.2(a).txt File size: 153 B (153 bytes) > dfCZ <- getChecksumFile(dfC) > print(dfCZ) ChecksumFile: Name: 1.2(a).txt Tags: Full name: 1.2(a).txt Pathname: d:/temp/RtmpQ9Zo4o/1.2(a).txt.md5 File size: 32 B (32 bytes) Checksum on record: 932b17dafa6774b5a36fd71420ffe706 > > pathnameZZ <- sprintf("%s.md5", getPathname(dfCZ)) > print(file.info(pathnameZZ)) size isdir mode mtime ctime ../../../../../temp/RtmpQ9Zo4o/1.2(a).txt.md5.md5 NA NA atime exe ../../../../../temp/RtmpQ9Zo4o/1.2(a).txt.md5.md5 > stopifnot(!isFile(pathnameZZ)) > > ## Calling getChecksum() on an *.md5 file should not > ## create an *.md5.md5 file > print(getChecksum(dfCZ)) [1] "56c4c0132980e7273177595f7e3bc1d4" > print(file.info(pathnameZZ)) size isdir mode mtime ctime ../../../../../temp/RtmpQ9Zo4o/1.2(a).txt.md5.md5 NA NA atime exe ../../../../../temp/RtmpQ9Zo4o/1.2(a).txt.md5.md5 > stopifnot(!isFile(pathnameZZ)) > > > message("*** ChecksumFile / ChecksumFileSet ... DONE") *** ChecksumFile / ChecksumFileSet ... DONE > > source("incl/end.R") > > proc.time() user system elapsed 8.40 59.07 69.10