--- fuse-comp.pl 2007/07/09 17:35:26 21 +++ fuse-comp.pl 2007/07/09 21:41:58 23 @@ -12,6 +12,15 @@ use Data::Dump qw/dump/; use Carp qw/confess/; use IO::File; +use Getopt::Long; + +my $debug = 0; +my $fuse_debug = 0; + +GetOptions( + 'debug+' => \$debug, + 'fuse-debug+' => \$fuse_debug, +); my $mount = { from => '/tmp/comp', @@ -159,7 +168,11 @@ my $dest_path = $tmp; $dest_path =~ s!/[^/]+$!!; #!vim-fix mkpath $dest_path unless -e $dest_path; - file_copy( '<:gzip', $path, '>', $tmp ); + if ( -s $path ) { + file_copy( '<:gzip', $path, '>', $tmp ) + } else { + warn "ERROR: filesystem corruption, $path is zero size\n"; + } $path = $tmp; } @@ -243,8 +256,9 @@ my $path = $pending->{$old}->{path}; $path =~ s/\Q$old\E/$new/; $pending->{$new}->{path} = $path; + $pending->{$old}->{path} = $path; - delete( $pending->{$old} ); + #delete( $pending->{$old} ); } return $err; @@ -374,5 +388,5 @@ statfs =>"main::x_statfs", release =>"main::x_release", # threaded=>1, -# debug => 1, + debug => $fuse_debug, );