}
sub path_remove {
- my ( $path ) = @_;
+ my $path = shift;
my $deleted = CloudStore::JSON::file_data( $path );
- my ( undef, undef, undef, $nlink ) = stat "md5/$deleted->{md5}";
+ my $md5_path = "md5/$deleted->{md5}";
- warn "path_remove $path $nlink ",dump $deleted;
+ my ( undef, undef, undef, $nlink ) = stat $md5_path;
+ warn "path_remove $path $nlink ",dump $deleted;
+ open(my $fh, '>>', 'var/dedup.log');
+ print $fh join(' ', $md5_path, $nlink, @_), $/;
+ close $fh;
}
my $empty_md5 = " " x 32;
if ( $data->{md5} ne $empty_md5 ) {
path_md5 $path => $data->{md5};
} else {
- path_remove $path;
+ path_remove $path, $data->{timestamp};
}
}