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)