projects
/
perl-fuse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a52da2e
)
Update the readdir example to use the new syntax, so it'll actually work.
author
Derrik Pates
<demon@now.ai>
Thu, 19 May 2011 17:10:09 +0000
(11:10 -0600)
committer
Derrik Pates
<demon@now.ai>
Thu, 19 May 2011 17:10:09 +0000
(11:10 -0600)
examples/readdir.pl
patch
|
blob
|
history
diff --git
a/examples/readdir.pl
b/examples/readdir.pl
index
514bf5a
..
63023bf
100755
(executable)
--- a/
examples/readdir.pl
+++ b/
examples/readdir.pl
@@
-56,10
+56,14
@@
sub e_getattr {
}
sub e_readdir {
- my ($path,$offset) = @_;
+
my ($path,$offset) = @_;
print "readdir $path $offset\n";
+ my $stridelen = 9;
+ my $last = $offset + $stridelen;
my @a = keys %files;
- return $a[$offset], 1 + $offset, $offset < $#a ? 0 : -ENOENT();
+ if ($last > $#a) { $last = $#a; }
+ my @ents = map { [ $_, $a[$_] ] } $offset .. $last;
+ return @ents, $offset < $#a ? 0 : -ENOENT();
}
sub e_open {