-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
stat.go
35 lines (29 loc) · 1019 Bytes
/
stat.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package fs
import (
"os"
"time"
)
// ExtendedFileInfo is an extended stat_t, filled with attributes that are
// supported by most operating systems. The original FileInfo is embedded.
type ExtendedFileInfo struct {
os.FileInfo
DeviceID uint64 // ID of device containing the file
Inode uint64 // Inode number
Links uint64 // Number of hard links
UID uint32 // owner user ID
GID uint32 // owner group ID
Device uint64 // Device ID (if this is a device file)
BlockSize int64 // block size for filesystem IO
Blocks int64 // number of allocated filesystem blocks
Size int64 // file size in byte
AccessTime time.Time // last access time stamp
ModTime time.Time // last (content) modification time stamp
ChangeTime time.Time // last status change time stamp
}
// ExtendedStat returns an ExtendedFileInfo constructed from the os.FileInfo.
func ExtendedStat(fi os.FileInfo) ExtendedFileInfo {
if fi == nil {
panic("os.FileInfo is nil")
}
return extendedStat(fi)
}