Nov 282009
 

Version 0.4, released 2009-11-27: http://dsp.mcbf.net/checkcopy/checkcopy-0.4.tar.bz2

Checkcopy is a copy program which computes checksums on the fly to verify them
and/or write them out to disk.

This program will copy one or more files / directories to a destination,
and compute its checksum on the fly. If checksum files are getting copied
over, their contents are parsed and compared to the computed checksums. If no
checksum was found for a file, then the computed one is written to disk.

So in the end at the destination every file has a checksum stored on disk, and all files which already had a checksum are verified.

Checkcopy uses GIO, and as such operates on local and remote files /
destinations.

Known Issues

W A R N I N G:
Similarly to how `cp’ works, checkcopy currently overwrites destination
files without warning!

Usage

1. The source files / directories have to be specified on the command line.
So running just “checkcopy” is not going to get you anywhere. See TODO.

2. The destination is can be predetermined, preselected, or simply selected.
a. If a destination was specified by the -d switch, then the user
will not get asked.
b. If a default destination was specified by the -D switch, then a file
chooser will get displayed, starting at the specified URI.
c. Otherwise, a file chooser will be shown with the current directory as the
starting location.

This should allow easy bindings in file managers.

Before the files are being copied, they are scanned for checksum files.
Currently only files ending in .md5, .sha, .sha1 and CHECKSUM are detected as
containing checksums. Its contents are then parsed, and remembered.

While the files are copied, the checksum is created. If a checksum is on file,
it will get compared. If no checksum was previously discovered, the computed
one is written to disk as /foo/bar/${DESTINATION}/${DESTINATION}.CHECKSUM
(currently always as sha1).

Requirements

checkcopy requires the following libraries to be installed:

  • gtk+ toolkit:
    Checkcopy was tested with gtk 2.18.3, but gtk 2.16 would probably suffice.
  • gio:
    All file operations are based on GIO functions.
  • libxfce4util:
    Required for some utility functions.

Development

The development code can be found at http://github.com/squisher/checkcopy/

Feedback

Please check the TODO file for the current plan for checkcopy.

All comments, feedback, and bug reports are very welcome! Please email the
author at david@mcbf.net .

Nov 282009
 

Version 0.1, released 2008-07-20
This program is deprecated. Please now use checkcopy, which has more functionality and is more reliable.

This program will copy one or more files / directories to a destination,
and compute an md5 checksum on the fly. Currently the .md5 files are generated
per directory.

Usage

The source files / directories have to be specified on the command line. Then
a dialog will pop up asking you for the destination, unless it was also
specified on the command line (-d switch).

This should allow easy bindings in file managers.

W A R N I N G

  Similarly to how `cp' works, md5copy currently overwrites destination
  files without warning!

The checksum will be saved in one .md5 file per directory. So if you have a
layout like:

a/
  sub1/
    (some files)
  sub2/
    (some files)

you would end up with the following checksum files:

  • a/sub1/sub1.md5
  • a/sub2/sub2.md5

Note that there is no a/a.md5, because there were no files (just directories)
inside of a/.

I recommend the program cfv to verify files. cfv has the ‘-r’ switch, which
allows you to verify a whole directory structure copied with md5copy.

Internals

At the moment md5copy is slightly unoptimized to copy a large number of small files, since the total size of the copy operation is calculated first.

The mhash library is used to compute the checksum. This should make md5copy pretty reliable, and at no point in testing there was ever an incorrect checksum.

md5copy should be pretty fast. The reading part was inspired by GNU coreutil’s md5sum. GUI, copy and hashing are all run in separate threads, so the hashing should not slow down the copying (although this statement has not benchmarked very well).

Requirements

md5copy requires the following libraries to be installed:

  • gtk+ toolkit:
    it was tested with gtk 2.12.11, but probably gtk 2.10 would suffice
  • mhash library:
    it was tested with 0.9.9 (libmhash2 in Debian)

the manpage refers to 0.9.2, so I assume that’s the minimum required

Feedback / Bugs

I’m interested in feedback! Did it work fast? Could you tune something in settings.h? Did you find a bug? Let me know by sending an email to david at x.mcbf.net (remove the x. to get a valid email address)

Download