github.com/telepresenceio/telepresence/v2@v2.20.0-pro.6.0.20240517030216-236ea954e789/pkg/client/logging/stat.go (about) 1 package logging 2 3 import ( 4 "fmt" 5 "time" 6 7 "github.com/telepresenceio/telepresence/v2/pkg/dos" 8 ) 9 10 // FStat returns the file status/info of an open file. 11 func FStat(file dos.File) (SysInfo, error) { 12 return osFStat(file) 13 } 14 15 // SysInfo represents the elaborate info in a FileInfo.Sys(). The implementations are 16 // os specific. 17 // 18 // Unix: 19 // 20 // info.Sys().(*syscall.Stat_t) 21 // 22 // Windows: 23 // 24 // info.Sys().(*syscall.Win32FileAttributeData) 25 type SysInfo interface { 26 fmt.Stringer 27 28 Size() int64 29 30 BirthTime() time.Time 31 ModifyTime() time.Time // most recent content change 32 ChangeTime() time.Time // most recent metadata change 33 34 SetOwnerAndGroup(name string) error 35 36 HaveSameOwnerAndGroup(SysInfo) bool 37 }