in reply to Best way to append bigger files
FWIW: On my single-disk, Windows system, this is almost twice as fast as File::Copy.
Here, using a 10 MB buffer seems to strike the right balance between latency and head shuffling; but if you are on a multi-disk system that balance point may be considerably different.
#! perl -slw use strict; our $BUFSIZE //= 10*1024**2; my( $source, $target ) = @ARGV; open IN, '<', $source or die "$source: $!"; binmode IN; open OUT, '>>', $target or die "$target: $!"; binmode OUT; { local( $/, $\ ) = \$BUFSIZE; print OUT while <IN>; } close OUT; close IN;
|
|---|