add proper error handling for all final exec calls
[hband-tools.git] / user-tools / fcomplete
blob10d50acb68c9693748f29d3c42493defae29ee73
1 #!/usr/bin/env perl
3 use warnings;
5 open $src, '<:raw', $ARGV[0] or die "$!\n";
6 open $dst, '>>:raw', $ARGV[1] or die "$!\n";
8 seek($src, tell $dst, 0) or die "$!\n";
10 LOOP:
11 $bytes = read $src, $buf, 4096;
12 defined $bytes or die "$!\n";
13 print {$dst} $buf or die "$!\n";
14 $bytes > 0 or exit 0;
15 goto LOOP;
17 __END__
19 =pod
21 =head1 NAME
23 fcomplete - Complete a smaller file with the data from a bigger one
25 =cut
27 EOF