X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=bin%2FBackupPC_compressPool;h=acf360427920fcc2c8b34378413406fc7d177080;hb=2a19fd178108b0898e79d2b8908236429ca4c6a3;hp=07f866199a78f4e95efec26ba751e5afbd39fd79;hpb=0697368bbcef14908cd4684cf07744dc840464de;p=BackupPC.git diff --git a/bin/BackupPC_compressPool b/bin/BackupPC_compressPool index 07f8661..acf3604 100755 --- a/bin/BackupPC_compressPool +++ b/bin/BackupPC_compressPool @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_compressPool: Compress existing pool @@ -31,7 +31,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2001 Craig Barratt +# Copyright (C) 2001-2003 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -49,19 +49,20 @@ # #======================================================================== # -# Version 2.0.0_CVS, released 18 Jan 2003. +# Version 2.1.3, released 21 Jan 2007. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use File::Find; use File::Path; use Compress::Zlib; use Getopt::Std; -use lib "/usr/local/BackupPC/lib"; +use lib "/usr/local/BackupPC2.1.0/lib"; use BackupPC::Lib; use BackupPC::FileZIO; @@ -178,6 +179,7 @@ sub doCompress $Errors++; return; } + binmode(FH); while ( sysread(FH, $dataIn, $CompMaxWrite) > 0 ) { $flush = 0; $FileOrigSz += length($dataIn); @@ -202,6 +204,7 @@ sub doCompress close(FH); return; } + binmode(OUT); $copy = 1; } if ( $copy && $dataOut ne "" ) { @@ -244,6 +247,7 @@ sub doCompress unlink("$file.__z"); return; } + binmode(FH); } if ( $copy ) { if ( !sysseek(OUT, 0, 0) ) { @@ -329,6 +333,7 @@ sub checkRead $f->close(); return; } + binmode(FH); #print("comparing $file to $cfile\n"); while ( 1 ) { $n = 1 + int(rand($CompMaxRead) + rand(100)); @@ -363,6 +368,7 @@ sub checkReadLine $f->close(); return; } + binmode(FH); while ( 1 ) { $d0 = ; $d = $f->readLine();