本文整理汇总了Golang中github.com/y-okubo/go-fuse/fuse.Attr.SetTimes方法的典型用法代码示例。如果您正苦于以下问题:Golang Attr.SetTimes方法的具体用法?Golang Attr.SetTimes怎么用?Golang Attr.SetTimes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/y-okubo/go-fuse/fuse.Attr
的用法示例。
在下文中一共展示了Attr.SetTimes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: HeaderToFileInfo
func HeaderToFileInfo(out *fuse.Attr, h *tar.Header) {
out.Mode = uint32(h.Mode)
out.Size = uint64(h.Size)
out.Uid = uint32(h.Uid)
out.Gid = uint32(h.Gid)
out.SetTimes(&h.AccessTime, &h.ModTime, &h.ChangeTime)
}
示例2: Create
func (fs *unionFS) Create(name string, flags uint32, mode uint32, context *fuse.Context) (fuseFile nodefs.File, code fuse.Status) {
writable := fs.fileSystems[0]
code = fs.promoteDirsTo(name)
if code != fuse.OK {
return nil, code
}
fuseFile, code = writable.Create(name, flags, mode, context)
if code.Ok() {
fuseFile = fs.newUnionFsFile(fuseFile, 0)
fs.removeDeletion(name)
now := time.Now()
a := fuse.Attr{
Mode: fuse.S_IFREG | mode,
}
a.SetTimes(nil, &now, &now)
fs.branchCache.Set(name, branchResult{&a, fuse.OK, 0})
}
return fuseFile, code
}