Fixing terrible bug where directories and files were interchanged

This commit is contained in:
Alex Yatskov 2015-05-18 10:48:12 +09:00
parent adb06273ab
commit 378154d5a3
2 changed files with 3 additions and 9 deletions

4
dir.go
View File

@ -63,12 +63,12 @@ func (this versionedDir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)
}
for name, dir := range this.dirs {
entry := fuse.Dirent{Inode: dir.inode, Name: name, Type: fuse.DT_File}
entry := fuse.Dirent{Inode: dir.inode, Name: name, Type: fuse.DT_Dir}
entries = append(entries, entry)
}
for name, file := range this.files {
entry := fuse.Dirent{Inode: file.inode, Name: name, Type: fuse.DT_Dir}
entry := fuse.Dirent{Inode: file.inode, Name: name, Type: fuse.DT_File}
entries = append(entries, entry)
}

8
vfs.go
View File

@ -34,13 +34,7 @@ func main() {
log.Fatal(err)
}
c, err := fuse.Mount(
"mp",
fuse.FSName("vfs"),
fuse.Subtype("vfs"),
fuse.LocalVolume(),
fuse.VolumeName("vfs"),
)
c, err := fuse.Mount("mp")
if err != nil {
log.Fatal(err)
}