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) }
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 }