2 #============================================================= -*-perl-*-
4 # BackupPC_zcat: uncompress files to stdout
8 # Usage: BackupPC_zcat [files...]
10 # BackupPC_zcat is a command-line utility for uncompressing BackupPC
14 # Craig Barratt <cbarratt@users.sourceforge.net>
17 # Copyright (C) 2001 Craig Barratt
19 # This program is free software; you can redistribute it and/or modify
20 # it under the terms of the GNU General Public License as published by
21 # the Free Software Foundation; either version 2 of the License, or
22 # (at your option) any later version.
24 # This program is distributed in the hope that it will be useful,
25 # but WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 # GNU General Public License for more details.
29 # You should have received a copy of the GNU General Public License
30 # along with this program; if not, write to the Free Software
31 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 #========================================================================
35 # Version 2.0.0beta1, released 30 Mar 2003.
37 # See http://backuppc.sourceforge.net.
39 #========================================================================
43 use lib "/usr/local/BackupPC/lib";
45 use BackupPC::FileZIO;
49 my($fh, $fileName) = @_;
52 while ( ($r = $fh->read(\$data, 65536)) > 0 ) {
56 print(STDERR "$0: can't uncompress $fileName\n");
63 if ( defined(my $fh = BackupPC::FileZIO->open($ARGV[0], 0, 1)) ) {
66 print(STDERR "$0: can't open $ARGV[0]\n");
72 my $fh = BackupPC::FileZIO->open(*STDIN, 0, 1);