fusego/internal/fusekernel/fuse_kernel_darwin.go

89 lines
1.5 KiB
Go
Raw Normal View History

2015-07-23 08:54:32 +03:00
package fusekernel
2015-07-23 08:47:23 +03:00
import (
"time"
)
2015-07-23 08:58:40 +03:00
type Attr struct {
2015-07-23 08:47:23 +03:00
Ino uint64
Size uint64
Blocks uint64
Atime uint64
Mtime uint64
Ctime uint64
Crtime_ uint64 // OS X only
AtimeNsec uint32
MtimeNsec uint32
CtimeNsec uint32
CrtimeNsec uint32 // OS X only
Mode uint32
Nlink uint32
Uid uint32
Gid uint32
Rdev uint32
Flags_ uint32 // OS X only; see chflags(2)
Blksize uint32
padding uint32
}
2015-07-23 08:58:40 +03:00
func (a *Attr) SetCrtime(s uint64, ns uint32) {
2015-07-23 08:47:23 +03:00
a.Crtime_, a.CrtimeNsec = s, ns
}
2015-07-23 08:58:40 +03:00
func (a *Attr) SetFlags(f uint32) {
2015-07-23 08:47:23 +03:00
a.Flags_ = f
}
2015-07-23 09:11:50 +03:00
type SetattrIn struct {
2015-07-23 08:47:23 +03:00
setattrInCommon
// OS X only
Bkuptime_ uint64
Chgtime_ uint64
Crtime uint64
BkuptimeNsec uint32
ChgtimeNsec uint32
CrtimeNsec uint32
Flags_ uint32 // see chflags(2)
}
2015-07-23 09:11:50 +03:00
func (in *SetattrIn) BkupTime() time.Time {
2015-07-23 08:47:23 +03:00
return time.Unix(int64(in.Bkuptime_), int64(in.BkuptimeNsec))
}
2015-07-23 09:11:50 +03:00
func (in *SetattrIn) Chgtime() time.Time {
2015-07-23 08:47:23 +03:00
return time.Unix(int64(in.Chgtime_), int64(in.ChgtimeNsec))
}
2015-07-23 09:11:50 +03:00
func (in *SetattrIn) Flags() uint32 {
2015-07-23 08:47:23 +03:00
return in.Flags_
}
func openFlags(flags uint32) OpenFlags {
return OpenFlags(flags)
}
2015-07-23 09:11:50 +03:00
type GetxattrIn struct {
2015-07-23 08:47:23 +03:00
getxattrInCommon
// OS X only
Position uint32
Padding uint32
}
2015-07-23 09:16:42 +03:00
func (g *GetxattrIn) GetPosition() uint32 {
return g.Position
}
2015-07-23 09:11:50 +03:00
type SetxattrIn struct {
2015-07-23 08:47:23 +03:00
setxattrInCommon
// OS X only
Position uint32
Padding uint32
}
2015-07-23 09:16:42 +03:00
func (s *SetxattrIn) GetPosition() uint32 {
return s.Position
}