--- fuse-comp.pl 2007/07/16 08:24:08 35 +++ fuse-comp.pl 2007/09/02 11:38:59 38 @@ -10,7 +10,7 @@ use PerlIO::gzip; use File::Path; use Data::Dump qw/dump/; -use Carp qw/confess/; +use Carp qw/confess cluck/; use IO::File; use Getopt::Long; @@ -25,11 +25,13 @@ ); my $mount = { - from => '/tmp/comp', - to => '/tmp/no-comp', - tmp => '/dev/shm/comp', + from => shift @ARGV || '/tmp/comp', + to => shift @ARGV || '/tmp/no-comp', + tmp => shift @ARGV || '/dev/shm/comp', }; +warn "mount $mount->{from} to $mount->{to} using $mount->{tmp} as cache\n"; + my $skip_extensions_regex = qr/gz|gz%|\.(?:sw[a-z]|gif|png|jpeg|jpg|avi|rar|zip|bz2|tgz|avi|mpeg|mpg|tmp|temp)$/i; # don't compress files smaller than this @@ -47,7 +49,7 @@ sub real_name { my ( $dir, $name ) = @_; if ( -e "$dir/${name}.gz" ) { - confess "ASSERT: unexpected $dir/$name exists" if -e "$dir/$name"; + cluck "ASSERT: unexpected $dir/$name exists" if -e "$dir/$name"; return "${name}.gz"; } if ( $name =~ m/\.gz$/ ) {