github.com/slspeek/camlistore_namedsearch@v0.0.0-20140519202248-ed6f70f7721a/pkg/schema/schema_darwin.go (about) 1 //+build darwin 2 //+build !appengine 3 4 package schema 5 6 import ( 7 "os" 8 "syscall" 9 "time" 10 ) 11 12 func init() { 13 populateSchemaStat = append(populateSchemaStat, populateSchemaCtime) 14 } 15 16 func populateSchemaCtime(m map[string]interface{}, fi os.FileInfo) { 17 st, ok := fi.Sys().(*syscall.Stat_t) 18 if !ok { 19 return 20 } 21 22 // Include the ctime too, if it differs. 23 sec, nsec := st.Ctimespec.Unix() 24 ctime := time.Unix(sec, nsec) 25 if sec != 0 && !ctime.Equal(fi.ModTime()) { 26 m["unixCtime"] = RFC3339FromTime(ctime) 27 } 28 }