#----------------------------------------------------------------
#
#  FUNCTION NAME:
#     FileCopy
#  DESCRIPTION:
#     Copies a file from src to dest
#  REQUIRES:
#  ARGUMENTS:
#     $src - source file, $dest - destination
#  RANGE OF INPUTS:
#     two valid file paths
#  RETURN VALUES:
#     whether or not successful
#  INVARIANT:
#  NOTES:
#----------------------------------------------------------------
package filecopy;
sub FileCopy {
    local ($src, $dest) = @_;
    local ($contents, $bytesread);

    local ($slash) = $/;
    local ($backslash) = $\;
    undef $/;
    undef $\;
    open (INFILE, $src);
    open (OUTFILE, ">$dest");
    binmode (INFILE);
    binmode (OUTFILE);
    while ($bytesread = sysread (INFILE, $contents, 32000)) {
        syswrite (OUTFILE, $contents, $bytesread);
    };
    close (INFILE);
    close (OUTFILE);
    $/ = $slash;
    $\ = $backslash;
}
1;
