~vladh/fotografiska2

f73e741a8ebb965c8580064986a27a3b4e199fdd — Vlad-Stefan Harbuz 1 year, 8 months ago 59b49a7
improve ctime method
1 files changed, 7 insertions(+), 1 deletions(-)

M main.go
M main.go => main.go +7 -1
@@ 174,7 174,13 @@ func getFileCtime(path string) time.Time {
	fi, err := os.Stat(path)
	if err != nil { panic(err) }
	stat := fi.Sys().(*syscall.Stat_t)
	return time.Unix(int64(stat.Ctim.Sec), int64(stat.Ctim.Nsec))
	ctim := time.Unix(int64(stat.Ctim.Sec), int64(stat.Ctim.Nsec))
	mtim := time.Unix(int64(stat.Mtim.Sec), int64(stat.Mtim.Nsec))
	if (ctim.Before(mtim)) {
		return ctim
	} else {
		return mtim
	}
}