本文整理匯總了Golang中github.com/hanwen/go-fuse/fuse.Attr.Atimensec方法的典型用法代碼示例。如果您正苦於以下問題:Golang Attr.Atimensec方法的具體用法?Golang Attr.Atimensec怎麽用?Golang Attr.Atimensec使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/hanwen/go-fuse/fuse.Attr
的用法示例。
在下文中一共展示了Attr.Atimensec方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: GetAttr
func (f *file) GetAttr(out *fuse.Attr) fuse.Status {
logrus.Debugf("FGetAttr %s", f.kv.Key)
now := time.Now()
out.Mtime = uint64(now.Unix())
out.Mtimensec = uint32(now.UnixNano())
out.Atime = uint64(now.Unix())
out.Atimensec = uint32(now.UnixNano())
out.Ctime = uint64(now.Unix())
out.Ctimensec = uint32(now.UnixNano())
if f.kv == nil || strings.HasSuffix(f.kv.Key, "/") || f.kv.Key == "" {
out.Mode = fuse.S_IFDIR | 0755
return fuse.OK
}
if len(f.kv.Value) > 0 {
out.Mode = fuse.S_IFREG | 0644
out.Size = uint64(len(f.kv.Value))
}
return fuse.OK
}