use File::ExtAttr instead of shell commands
[cloudstore.git] / lib / CloudStore / MD5sum.pm
index c849e63..f0e08f3 100644 (file)
@@ -4,17 +4,18 @@ use strict;
 
 use Carp qw(confess carp);
 use Data::Dump qw(dump);
+use File::ExtAttr ':all';
 
 sub md5_get {
        my ( $self, $path ) = @_;
-       my $md5 = `attr -q -g md5 $path`;
+       my $md5 = getfattr( $path, 'md5' );
        warn "## md5_get $path $md5\n";
        return $md5;
 }
 
 sub md5_set {
        my ( $self, $path, $md5 ) = @_;
-       system "attr -q -s md5 -V $md5 $path";
+       setfattr( $path, md5 => $md5 );
        warn "## md5_set $path $md5\n";
        return $md5;
 }