projects
/
BackupPC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Changed BackupPC::Lib so that user check is optional in new()
[BackupPC.git]
/
lib
/
BackupPC
/
FileZIO.pm
diff --git
a/lib/BackupPC/FileZIO.pm
b/lib/BackupPC/FileZIO.pm
index
05f28e6
..
e126b94
100644
(file)
--- a/
lib/BackupPC/FileZIO.pm
+++ b/
lib/BackupPC/FileZIO.pm
@@
-29,7
+29,7
@@
#
#========================================================================
#
#
#========================================================================
#
-# Version
1.6.0_CVS, released 10 Dec 2002
.
+# Version
2.0.0beta2, released 13 Apr 2003
.
#
# See http://backuppc.sourceforge.net.
#
#
# See http://backuppc.sourceforge.net.
#
@@
-95,9
+95,9
@@
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;
}
$fh = *FH;
}
}
$fh = *FH;
}
@@
-246,6
+246,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
+304,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
+352,7
@@
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) ) {
while ( sysread(LOG, $data, 65536) > 0 ) {
$fh->write(\$data);
}
while ( sysread(LOG, $data, 65536) > 0 ) {
$fh->write(\$data);
}