use File::ExtAttr instead of shell commands
[cloudstore.git] / lib / CloudStore / MD5sum.pm
1 package CloudStore::MD5sum;
2 use warnings;
3 use strict;
4
5 use Carp qw(confess carp);
6 use Data::Dump qw(dump);
7 use File::ExtAttr ':all';
8
9 sub md5_get {
10         my ( $self, $path ) = @_;
11         my $md5 = getfattr( $path, 'md5' );
12         warn "## md5_get $path $md5\n";
13         return $md5;
14 }
15
16 sub md5_set {
17         my ( $self, $path, $md5 ) = @_;
18         setfattr( $path, md5 => $md5 );
19         warn "## md5_set $path $md5\n";
20         return $md5;
21 }
22
23 1;