From 137b24614a391dd472e352cb64ad3ea38892b8ff Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Fri, 27 Feb 2015 12:38:27 +1100 Subject: [PATCH] Fixed a bug. --- samples/hello_fs.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/hello_fs.go b/samples/hello_fs.go index 64a5b8d..f1cb20b 100644 --- a/samples/hello_fs.go +++ b/samples/hello_fs.go @@ -76,12 +76,14 @@ func (fs *HelloFS) ReadDir( return } - // Check the offset. - if req.Offset >= fuse.DirOffset(len(entries)) { + // Grab the range of interest. + if req.Offset > fuse.DirOffset(len(entries)) { err = fuse.EIO return } + entries = entries[req.Offset:] + // Resume at the specified offset into the array. for _, e := range entries { resp.Data = fuseutil.AppendDirent(resp.Data, e)