#
my ($ProgramName, $UsageLong, $UsageShort, $VERSION);
-$VERSION = '2.0';
+$VERSION = '2.1';
# Looks nicer without the slashes and dots
($ProgramName = $0) =~ s!.*/!!; # strip dir
$file_new .= '.cp-update.new'; # our .new file
$file_old .= '.cp-update.old'; # our .old file
# write content in new file in single write op
- sysopen ($FileHandle, $file_new, O_CREAT|O_TRUNC|O_WRONLY)
+ sysopen ($FileHandle, $file_new, O_CREAT|O_TRUNC|O_WRONLY, (stat($File))[2])
or die "$ProgramName: Failed to open file '$File' for writing ($!)\n";
if (length($newContent)) {
my $wb = syswrite($FileHandle, $newContent);
unlink($file_old)
or warn "$ProgramName: Failed to remove file '$file_old' ($!)\n";
}
+ DEBUG and print STDERR "actualize: LinesCount=$LinesCount\n";
}
# return content from standard input