projects
/
BackupPC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* removed Host_or_User_name from lang files
[BackupPC.git]
/
lib
/
BackupPC
/
FileZIO.pm
diff --git
a/lib/BackupPC/FileZIO.pm
b/lib/BackupPC/FileZIO.pm
index
05f28e6
..
4bae50a
100644
(file)
--- a/
lib/BackupPC/FileZIO.pm
+++ b/
lib/BackupPC/FileZIO.pm
@@
-11,7
+11,7
@@
# Craig Barratt <cbarratt@users.sourceforge.net>
#
# COPYRIGHT
# Craig Barratt <cbarratt@users.sourceforge.net>
#
# 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
#
# 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
@@
-29,7
+29,7
@@
#
#========================================================================
#
#
#========================================================================
#
-# Version
1.6.0_CVS, released 10 Dec 2002
.
+# Version
2.1.0_CVS, released 3 Jul 2003
.
#
# See http://backuppc.sourceforge.net.
#
#
# See http://backuppc.sourceforge.net.
#
@@
-95,10
+95,11
@@
sub open
$fh = $fileName;
} else {
if ( $write ) {
$fh = $fileName;
} else {
if ( $write ) {
- open(FH, ">
$fileName"
) || return;
+ open(FH, ">
", $fileName
) || return;
} else {
} else {
- open(FH, "<
$fileName"
) || return;
+ open(FH, "<
", $fileName
) || return;
}
}
+ binmode(FH);
$fh = *FH;
}
$compLevel = 0 if ( !$CompZlibOK );
$fh = *FH;
}
$compLevel = 0 if ( !$CompZlibOK );
@@
-246,6
+247,7
@@
sub write
my $n = length($$dataRef);
return if ( !$self->{write} );
my $n = length($$dataRef);
return if ( !$self->{write} );
+ print($$dataRef) if ( $self->{writeTeeStdout} );
return 0 if ( $n == 0 );
if ( !$self->{compress} ) {
#
return 0 if ( $n == 0 );
if ( !$self->{compress} ) {
#
@@
-303,6
+305,14
@@
sub name
return $self->{name};
}
return $self->{name};
}
+sub writeTeeStdout
+{
+ my($self, $param) = @_;
+
+ $self->{writeTeeStdout} = $param if ( defined($param) );
+ return $self->{writeTeeStdout};
+}
+
sub close
{
my($self) = @_;
sub close
{
my($self) = @_;
@@
-343,7
+353,8
@@
sub compressCopy
if ( $CompZlibOK && $compress > 0 ) {
my $fh = BackupPC::FileZIO->open($destFileZ, 1, $compress);
my $data;
if ( $CompZlibOK && $compress > 0 ) {
my $fh = BackupPC::FileZIO->open($destFileZ, 1, $compress);
my $data;
- if ( defined($fh) && open(LOG, $srcFile) ) {
+ if ( defined($fh) && open(LOG, "<", $srcFile) ) {
+ binmode(LOG);
while ( sysread(LOG, $data, 65536) > 0 ) {
$fh->write(\$data);
}
while ( sysread(LOG, $data, 65536) > 0 ) {
$fh->write(\$data);
}