mountlib: make Node satisfy os.FileInfo interface

This commit is contained in:
Nick Craig-Wood
2017-10-25 10:00:26 +01:00
parent 54950d3423
commit 750690503e
5 changed files with 93 additions and 28 deletions

View File

@@ -30,10 +30,9 @@ var _ fusefs.Node = (*File)(nil)
// Attr fills out the attributes for the file
func (f *File) Attr(ctx context.Context, a *fuse.Attr) (err error) {
defer fs.Trace(f, "")("a=%+v, err=%v", a, &err)
modTime, Size, Blocks, err := f.File.Attr(mountlib.NoModTime)
if err != nil {
return translateError(err)
}
modTime := f.File.ModTime()
Size := uint64(f.File.Size())
Blocks := (Size + 511) / 512
a.Gid = mountlib.GID
a.Uid = mountlib.UID
a.Mode = mountlib.FilePerms