1 package schema 2 3 import ( 4 "os" 5 "syscall" 6 "time" 7 ) 8 9 func init() { 10 populateSchemaStat = append(populateSchemaStat, populateSchemaCtime) 11 } 12 13 func 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.Ctim.Unix() 21 ctime := time.Unix(sec, nsec) 22 if sec != 0 && !ctime.Equal(fi.ModTime()) { 23 m["unixCtime"] = RFC3339FromTime(ctime) 24 } 25 }