MCPcopy
hub / github.com/perkeep/perkeep / populateSchemaCtime

Function populateSchemaCtime

pkg/schema/schema_darwin.go:13–25  ·  view source on GitHub ↗
(m map[string]interface{}, fi os.FileInfo)

Source from the content-addressed store, hash-verified

11}
12
13func populateSchemaCtime(m map[string]interface{}, fi os.FileInfo) {
14 st, ok := fi.Sys().(*syscall.Stat_t)
15 if !ok {
16 return
17 }
18
19 // Include the ctime too, if it differs.
20 sec, nsec := st.Ctimespec.Unix()
21 ctime := time.Unix(sec, nsec)
22 if sec != 0 && !ctime.Equal(fi.ModTime()) {
23 m["unixCtime"] = RFC3339FromTime(ctime)
24 }
25}

Callers

nothing calls this directly

Calls 4

RFC3339FromTimeFunction · 0.85
SysMethod · 0.80
EqualMethod · 0.80
ModTimeMethod · 0.45

Tested by

no test coverage detected