From eaa9c427ac7405ba973787234471a9bb072f30a6 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sat, 14 Apr 2012 15:22:07 -0700 Subject: [PATCH] schema: include ctime, if it differs from mtime Change-Id: Ifc511cc9abb00cee870e5d12fae86d34dd00e054 --- pkg/schema/schema_posix.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/schema/schema_posix.go b/pkg/schema/schema_posix.go index 46bdcae83..49adf3e49 100644 --- a/pkg/schema/schema_posix.go +++ b/pkg/schema/schema_posix.go @@ -6,6 +6,7 @@ package schema import ( "os" "syscall" + "time" ) var _ = syscall.Close @@ -27,13 +28,12 @@ func populateSchemaUnix(m map[string]interface{}, fi os.FileInfo) { if group := getGroupFromGid(int(st.Gid)); group != "" { m["unixGroup"] = group } - /** - TODO-GO1(bradfitz): port this too. // Include the ctime too, if it differs. - if ctime := fi.Ctime_ns; ctime != 0 && fi.ModTime() != fi.Ctime_ns { + sec, nsec := st.Ctim.Unix() + println("ctime", sec, nsec) + ctime := time.Unix(sec, nsec) + if sec != 0 && !ctime.Equal(fi.ModTime()) { m["unixCtime"] = RFC3339FromTime(ctime) } - */ - }