2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-30 00:33:57 +00:00

fuse: use node.Type instead of node.Mode

This commit is contained in:
Alexander Neumann 2015-07-21 21:23:40 +02:00
parent aeb5a694d3
commit 99dae57b4f

View File

@ -66,10 +66,10 @@ func (d *dir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
for _, node := range d.children { for _, node := range d.children {
var typ fuse.DirentType var typ fuse.DirentType
switch { switch node.Type {
case node.Mode.IsDir(): case "dir":
typ = fuse.DT_Dir typ = fuse.DT_Dir
case node.Mode.IsRegular(): case "file":
typ = fuse.DT_File typ = fuse.DT_File
} }
@ -88,10 +88,10 @@ func (d *dir) Lookup(ctx context.Context, name string) (fs.Node, error) {
if !ok { if !ok {
return nil, fuse.ENOENT return nil, fuse.ENOENT
} }
switch { switch child.Type {
case child.Mode.IsDir(): case "dir":
return newDir(d.repo, child) return newDir(d.repo, child)
case child.Mode.IsRegular(): case "file":
return newFile(d.repo, child) return newFile(d.repo, child)
default: default:
return nil, fuse.ENOENT return nil, fuse.ENOENT