Allow opening other dirs.

geesefs-0-30-9
Aaron Jacobs 2015-02-27 14:43:05 +11:00
parent 985bd0ac2b
commit 39e09d6bdb
2 changed files with 3 additions and 9 deletions

View File

@ -192,14 +192,8 @@ func (fs *HelloFS) GetInodeAttributes(
func (fs *HelloFS) OpenDir( func (fs *HelloFS) OpenDir(
ctx context.Context, ctx context.Context,
req *fuse.OpenDirRequest) (resp *fuse.OpenDirResponse, err error) { req *fuse.OpenDirRequest) (resp *fuse.OpenDirResponse, err error) {
// We always allow opening the root directory. // Allow opening any directory.
if req.Inode == rootInode { resp = &fuse.OpenDirResponse{}
resp = &fuse.OpenDirResponse{}
return
}
// TODO(jacobsa): Handle others.
err = fuse.ENOSYS
return return
} }

View File

@ -121,7 +121,7 @@ func (t *HelloFSTest) ReadDir_Dir() {
var fi os.FileInfo var fi os.FileInfo
// world // world
fi = entries[1] fi = entries[0]
ExpectEq("world", fi.Name()) ExpectEq("world", fi.Name())
ExpectEq(len("Hello, world!"), fi.Size()) ExpectEq(len("Hello, world!"), fi.Size())
ExpectEq(0400, fi.Mode()) ExpectEq(0400, fi.Mode())