Commit ca4265a2 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Provide a DefaultFsNode.GetAttr()

parent 16ee6060
...@@ -20,6 +20,7 @@ func (me *DefaultNodeFileSystem) OnMount(conn *FileSystemConnector) { ...@@ -20,6 +20,7 @@ func (me *DefaultNodeFileSystem) OnMount(conn *FileSystemConnector) {
func (me *DefaultNodeFileSystem) StatFs() *StatfsOut { func (me *DefaultNodeFileSystem) StatFs() *StatfsOut {
return nil return nil
} }
func (me *DefaultNodeFileSystem) Root() FsNode { func (me *DefaultNodeFileSystem) Root() FsNode {
return new(DefaultFsNode) return new(DefaultFsNode)
} }
...@@ -124,7 +125,10 @@ func (me *DefaultFsNode) ListXAttr(context *Context) (attrs []string, code Statu ...@@ -124,7 +125,10 @@ func (me *DefaultFsNode) ListXAttr(context *Context) (attrs []string, code Statu
} }
func (me *DefaultFsNode) GetAttr(file File, context *Context) (fi *os.FileInfo, code Status) { func (me *DefaultFsNode) GetAttr(file File, context *Context) (fi *os.FileInfo, code Status) {
return nil, ENOSYS if me.Inode().IsDir() {
return &os.FileInfo{Mode: S_IFDIR | 0755}, OK
}
return &os.FileInfo{Mode: S_IFREG | 0644}, OK
} }
func (me *DefaultFsNode) Chmod(file File, perms uint32, context *Context) (code Status) { func (me *DefaultFsNode) Chmod(file File, perms uint32, context *Context) (code Status) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment