CrcCheckCopy - How it works

We describe here how to use CrcCheckCopy, to compare folders on Windows and/or Mac using the CRC hash checksum of each file. This is a command-line utility, so you first need to open the Command prompt (on Windows) or the Terminal (on MacOS) and then type the command and parameters to start the comparison.

Scan phase

Scans the files, calculates their CRC32 hash and saves it together with their file size in a file called CRCstamps.txt.

Assuming that you have downloaded and saved the CrcCheckCopy utility in the current working folder, you can start the scan by the command:

On Windows Command prompt, type:
CrcCheckCopy /scan c:\my-source-folder
On MacOS Terminal, type:
./CrcCheckCopy /scan /my-source-folder

The scan progress (which is the first part for the folder compare) will look like this:

CRC calculation of multiple files

The CRCstamps.txt will be saved in the current folder (working directory) and will look like this:

CRCstamps.txt
# This file is created by vCrcCheckCopy 2.1 (http://www.StarMessageSoftware.com)
# Date of run:2021-01-03 12:49:44
# Calculating the CRC signatures of the files in path:\tmp
# List of ignored files:
# \tmp\CRCstamps.txt
# Number of ignored files: 1
# Total files in source path:860
# List of files (relative paths), their CRC and their filesize:
"5.8.7.yaml" f1812144 1283
"5.9.4.yaml" 18620e4d 1443
"cpp-demo-win.iobj" 60862df6 583371
"cpp-demo-win.ipdb" 5e156ef8 156272
"cpp-demo-win.pdb" 36bc3764 4935680
.........
"Win32\Release\intermediate-Win32\libShareware.log" 1adb1e37 358
"winget.txt" 2dc6518 291

# End of scanned files, their CRC and their filesize.
# Performance statistics:
#  00:01:23.8 total processing time, of which,
#    00:00:00.3 were for the scanning of the disk folders and
#    00:00:00.2 for the sorting of the files in memory.
#  860 files, 998'276'859 bytes.
#  Processing rate: 10 files/sec, 11636 Kb/sec.

The CRC checksum is stored in HEX format because this is the common format for CRC codes, and the file size in decimal form because this is how the sizes are presented in file explorer (or MacOS finder) and in the DOS command prompt (or MacOS terminal).

Since CrcCheckCopy v2.2, the CRCstamps.txt will also contain a list of files that have a zero size and a list of duplicate files. The duplicate files are detected based on the file size and their file contents. CrcCheckCopy will detect all duplicate files even if they have different filenames, e.g. "myself.jpg" and "me-at-the-mountain.jpg".

CRCstamps.txt (Example of reporting the files of zero bytes and the duplicate files)
# ------------------------------------
# Files with zero size exist:
# "starmessage/probl.log" 0 0
# ------------------------------------
# Duplicate files found:
# ...................................
# "starmessage/screenshots/night-sky-screen.png" c23f4c44 1049845
# ...................................
# "starmessage-fork/screenshots/settings-clock.png" 8a2a2dcb 1165070
# "starmessage/screenshots/settings-clock.png" 8a2a2dcb 1165070
# ...................................
# "starmessage/bg-1024.jpg" 11c48fa6 17825395
# "starmessage/sky.jpg" 11c48fa6 17825395
# ------------------------------------
# The free edition of CrcCheckCopy will report up to 5 duplicate files.
# Please consider upgrading to the PRO version.
# ------------------------------------

Verification phase

Our folder comparison utility uses the CRCstamps.txt (that was created in the "scan" phase) to verify that each file on the "destination" folder has the same filesize and the same CRC32 hash checksum.

The CRCstamps.txt file must be in the current folder (working directory).

To start the verification (which is the 2nd phase of the folder comparison) use the command:

On Windows
CheckCopy /verify c:\my-destination-folder
On MacOS
./CheckCopy /verify /my-destination-folder

The folder comparison and CRC verification progress will look like this:

CRC calculation of multiple files

During the folder (directory) compare, CrcCheckCopy will check:

  1. if a file is missing, if not, then
  2. if a file has a different filesize, if not, then
  3. if the file has a different CRC32 hash.

The CRC comparison results are shown on screen but also logged in a report file named "CrcCheckCopy-verification-report.txt".

The report file will contain a list of missing files, files that have different file size and files that have different CRC checksum.

The report file is stored in the current folder (working directory) and will look like this:

CrcCheckCopy-verification-report.txt
Reading CRCstamps.txt and comparing files in the destination path:c:\tmp
Date of run:2021-01-03 14:27:56
List of files that did not pass the verification:
(missing files, files of different filesize, or different CRC)
--- Start of error report ------------------------------------------------------
[Different filesize] CrcCheckCopy-verification-report.txt
--- End of error report -------------------------------------------------------
Verification of the 860 files was completed.
Total number of errors: 1
Performance statistics:
  00:01:07.2 total processing time.
  860 files, 998'276'304 bytes.
  Processing rate: 12 files/sec, 14510 Kb/sec.

Duplicate file finder, zero-sized (empty) file finder

If you only want to find the duplicate files or the files that are empty (their file size is zero) you can run the find duplicates commant.

On Windows
CrcCheckCopy /d c:\folder-to-search-for-duplicates
On MacOS
./CrcCheckCopy /d /folder-to-search-for-duplicates

 

Requirements (Filesystem permissions needed)

The utility needs to create in the current directory a "CRCstamps.txt" file during the scanning/CRC generation phase and a report file during the file comparison phase.
Therefore, the user account that executes the program must have read+write permissions to the current directory (also called working directory).

For the folders that need to be scanned or compared, the user account that executes the program must have read permissions.