#copy #duplicate #directory #cli #command-line-tool

bin+lib copy_confirmer

Confirms all files are copied somewhere

5 releases

0.0.5 Sep 29, 2024
0.0.4 Nov 26, 2023
0.0.3 Oct 23, 2023
0.0.2 Oct 18, 2023
0.0.1 Mar 19, 2023

#900 in Filesystem


Used in duplicate_destroyer

AGPL-3.0-or-later

27KB
427 lines

Copy Confirmer

Command line tool that lets you check if one library is copied into other(s).

Usage

Warning: The crate is still pretty new and there are some big changes to the API to be expected.

Example: Check with one destination directory

To check if directory /path/to/source has been copied into /path/to/destination:

copcon -s /path/to/source -d /path/to/destination

If there are any files in the source dir missing in the destination (say, /path/to/source/missing_file is missing from /path/to/destination), the program will print the missing files:

Missing files:
"/path/to/source/missing_file"

Example: Check with multiple destinations

To check if /path/to/source has been divided into two directories /path/to/destination_1 and /path/to/destination_2 run:

copcon -s /path/to/source -d /path/to/destination_1 -d /path/to/destination_2

If all files in the source directory are present in one of the destination directories, copy confirmer will print:

All files present in destinations

We can also print a json containing all files in source and their paths in destinations using flags --print-found --out-file some_file.json.

CLI options

Usage: copcon [OPTIONS] --source <SOURCE> --destination <DESTINATION>

Options:
  -s, --source <SOURCE>            Source directory
  -d, --destination <DESTINATION>  Destination directories
  -j, --jobs <JOBS>                Number of threads for checksum calculation [default: 1]
  -o, --out-file <OUT_FILE>        Print json output to this file
  -f, --print-found                Print json with all files found if copy is confirmed
  -h, --help                       Print help
  -V, --version                    Print version

Dependencies

~7–16MB
~202K SLoC