turn into server
[cloudstore.git] / user-md5sum.pl
1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4
5 use TokyoCabinet;
6 use Data::Dump qw(dump);
7
8 my $user = shift @ARGV || die "usage: $0 u2001\n";
9
10 my $dir = (getpwnam($user))[7];
11
12 die $! unless -d $dir;
13
14 my $path = "$dir/.md5";
15
16 die "$path: $!\n" unless -r $path;
17
18 my %h;
19 tie %h, "TokyoCabinet::HDB", $path || die $!;
20
21 while( my($k,$v) = each(%h) ) {
22         $k = "$dir/$k" if $ENV{FULL};
23         print "$v  $k\n";
24 }
25