HashCp - Hash and copy the contents of a file or stdin.
hashcp {source|-} target
Note: Command line arguments are position dependent.
HashCp is a utility that hashes a file as it is being copied to new
name and/or location. The output produced by this utility is roughly
equivalent to FTimes output produced with the following FieldMask:
none+size+md5+sha1
It is not exactly equivalent to FTimes output because the name field
is not encoded and it may contain a relative path depending on how the
target file was specified.
Currently, HashCp only has one mode of operation, which is given in
the SYNOPSIS.
Upon successful completion, a value of 0 (XER_OK) is returned.
Otherwise, one of the following error codes is returned:
1 = XER_Usage
2 = XER_Abort
This example demonstrates how to hash a file called 'out' (in the
current directory) and copy it to '/tmp/out'.
hashcp out /tmp/out
This example demonstrates how to hash stdin and copy it to a file
called 'out.echo'. The data for stdin will be generated by the
echo(1) command.
echo "This is a test." | hashcp - out.echo
This example demonstrates how to hash stdin and copy it to a file
called 'out.zero'. The data for stdin will be generated by the dd(1)
command reading from /dev/zero.
dd if=/dev/zero bs=32k count=1 | hashcp - out.zero
cp(1), ftimes(1)
Klayton Monroe
This utility was initially written to make the process of copying and
validating files more efficient. For example, suppose you need to
archive some files for long-term storage (e.g., copy them to an
external drive). In that case, you may also want to verify the
integrity of those files before you store the drive away in your
evidence locker. This utility allows you to do both.
This utility first appeared in FTimes 3.9.0.
|