Skip to content

Commit

Permalink
cleanup example
Browse files Browse the repository at this point in the history
  • Loading branch information
dpavlin committed Feb 25, 2011
1 parent 9936732 commit fbfdda2
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions examples/readdir.pl
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,11 @@ sub e_getattr {
return ($dev,$ino,$modes,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks);
}

sub e_getdir {
# return as many text filenames as you like, followed by the retval.
print((scalar keys %files)."\n");
return (keys %files),0;
}

sub e_readdir {
use Data::Dumper;
print Dumper(\@_);
my ($path,$offset) = @_;
# return as many text filenames as you like, followed by the retval.
print((scalar keys %files)."\n");
my @a = keys %files;
return ($offset<0xFFFF ? $a[0] : undef),1+$offset,0;
print "readdir $path $offset\n";
my @a = keys %files;
return $a[$offset], 1 + $offset, $offset < $#a ? 0 : -ENOENT();
}

sub e_open {
Expand Down Expand Up @@ -107,7 +98,6 @@ sub e_read {
mountpoint=>$mountpoint,
getattr=>"main::e_getattr",
# getdir =>"main::e_getdir",
# getdir =>"main::e_readdir",
readdir=>"main::e_readdir",
open =>"main::e_open",
statfs =>"main::e_statfs",
Expand Down

0 comments on commit fbfdda2

Please sign in to comment.