cammount: add fuse mtime/atime/ctime

This commit is contained in:
Brad Fitzpatrick 2011-03-29 10:40:37 -07:00
parent 7b60456ea5
commit ca1f8f16ad
1 changed files with 9 additions and 1 deletions

View File

@ -237,7 +237,15 @@ func (fs *CamliFileSystem) GetAttr(name string) (*fuse.Attr, fuse.Status) {
fi.Size = int64(ss.Size)
}
// TODO: mtime and such
fi.Mtime_ns = schema.NanosFromRFC3339(ss.UnixMtime)
fi.Atime_ns = fi.Mtime_ns
fi.Ctime_ns = fi.Mtime_ns
if atime := schema.NanosFromRFC3339(ss.UnixAtime); atime > 0 {
fi.Atime_ns = atime
}
if ctime := schema.NanosFromRFC3339(ss.UnixCtime); ctime > 0 {
fi.Ctime_ns = ctime
}
fuse.CopyFileInfo(&fi, out)
fs.nameToAttr.Add(name, out)