/[fuse-comp]/fuse-comp.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /fuse-comp.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 21 by dpavlin, Mon Jul 9 17:35:26 2007 UTC revision 23 by dpavlin, Mon Jul 9 21:41:58 2007 UTC
# Line 12  use File::Path; Line 12  use File::Path;
12  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
13  use Carp qw/confess/;  use Carp qw/confess/;
14  use IO::File;  use IO::File;
15    use Getopt::Long;
16    
17    my $debug = 0;
18    my $fuse_debug = 0;
19    
20    GetOptions(
21            'debug+' => \$debug,
22            'fuse-debug+' => \$fuse_debug,
23    );
24    
25  my $mount = {  my $mount = {
26          from    => '/tmp/comp',          from    => '/tmp/comp',
# Line 159  sub x_open { Line 168  sub x_open {
168                  my $dest_path = $tmp;                  my $dest_path = $tmp;
169                  $dest_path =~ s!/[^/]+$!!;      #!vim-fix                  $dest_path =~ s!/[^/]+$!!;      #!vim-fix
170                  mkpath $dest_path unless -e $dest_path;                  mkpath $dest_path unless -e $dest_path;
171                  file_copy( '<:gzip', $path, '>', $tmp );                  if ( -s $path ) {
172                            file_copy( '<:gzip', $path, '>', $tmp )
173                    } else {
174                            warn "ERROR: filesystem corruption, $path is zero size\n";
175                    }
176                  $path = $tmp;                  $path = $tmp;
177          }          }
178    
# Line 243  sub x_rename { Line 256  sub x_rename {
256                  my $path = $pending->{$old}->{path};                  my $path = $pending->{$old}->{path};
257                  $path =~ s/\Q$old\E/$new/;                  $path =~ s/\Q$old\E/$new/;
258                  $pending->{$new}->{path} = $path;                  $pending->{$new}->{path} = $path;
259                    $pending->{$old}->{path} = $path;
260    
261                  delete( $pending->{$old} );                  #delete( $pending->{$old} );
262          }          }
263    
264          return $err;          return $err;
# Line 374  Fuse::main( Line 388  Fuse::main(
388          statfs  =>"main::x_statfs",          statfs  =>"main::x_statfs",
389          release =>"main::x_release",          release =>"main::x_release",
390  #       threaded=>1,  #       threaded=>1,
391  #       debug   => 1,          debug   => $fuse_debug,
392  );  );

Legend:
Removed from v.21  
changed lines
  Added in v.23

  ViewVC Help
Powered by ViewVC 1.1.26