2 #============================================================= -*-perl-*-
4 # BackupPC_attribPrint: print the contents of attrib files.
8 # Usage: BackupPC_attribPrint attribPath
10 # Compression status of attrib path is based on $Conf{CompressLevel}.
13 # Craig Barratt <cbarratt@users.sourceforge.net>
16 # Copyright (C) 2005 Craig Barratt
18 # This program is free software; you can redistribute it and/or modify
19 # it under the terms of the GNU General Public License as published by
20 # the Free Software Foundation; either version 2 of the License, or
21 # (at your option) any later version.
23 # This program is distributed in the hope that it will be useful,
24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 # GNU General Public License for more details.
28 # You should have received a copy of the GNU General Public License
29 # along with this program; if not, write to the Free Software
30 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #========================================================================
34 # Version 3.0.0, released 28 Jan 2007.
36 # See http://backuppc.sourceforge.net.
38 #========================================================================
42 use lib "/usr/local/BackupPC/lib";
45 use BackupPC::Attrib qw(:all);
46 use BackupPC::FileZIO;
49 die("BackupPC::Lib->new failed\n") if ( !(my $bpc = BackupPC::Lib->new) );
50 my $TopDir = $bpc->TopDir();
51 my $BinDir = $bpc->BinDir();
52 my %Conf = $bpc->Conf();
55 print STDERR "Usage: $0 attribPath\n";
59 print STDERR "$ARGV[0] does not exist\n";
63 my $attrib = BackupPC::Attrib->new({ compress => $Conf{CompressLevel} });
67 if ( $ARGV[0] =~ m{(.+)/(.+)} ) {
74 if ( !$attrib->read($dir, $file) ) {
75 print STDERR "Cannot read attrib file $ARGV[0]\n";
78 my $info = $attrib->get();
79 $Data::Dumper::Indent = 1;