idiosyncratic_copy 476 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/perl

use strict;
use warnings;

use File::Copy;

die "wrong number of arguments" if @ARGV != 2;
my ($source, $target) = @ARGV;
if ($^O eq 'msys')
{
	# make a windows path look like an msys path if necessary
	$source =~ s!^([A-Za-z]):!'/' . lc($1)!e;
	$source =~ s!\\!/!g;
}

die "$0: failed copy of $target" if -f "$target.fail";

copy($source, $target) or die "couldn't copy $source to $target: $!";
print STDERR "$0: archived $source to $target successfully\n";