X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=carnet-tools-cn.git;a=blobdiff_plain;f=cp-update;h=5514ee650c07b37d685e878133999c6c0b30726a;hp=4ae421331fea35eaf517af2ddaaf97e4d0d958f7;hb=refs%2Fheads%2Flenny;hpb=e8807059a3626188bc1385bd1e203358c1aafc17 diff --git a/cp-update b/cp-update index 4ae4213..5514ee6 100755 --- a/cp-update +++ b/cp-update @@ -35,7 +35,7 @@ sub DEBUG () { 0 }; # my ($ProgramName, $UsageLong, $UsageShort, $VERSION); -$VERSION = '2.0'; +$VERSION = '2.1'; # Looks nicer without the slashes and dots ($ProgramName = $0) =~ s!.*/!!; # strip dir @@ -459,7 +459,7 @@ sub actualize() { $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);