8 // Chtimes changes the access time and modified time of a file at the given path
9 func Chtimes(name string, atime time.Time, mtime time.Time) error {
10 unixMinTime := time.Unix(0, 0)
11 unixMaxTime := maxTime
13 // If the modified time is prior to the Unix Epoch, or after the
14 // end of Unix Time, os.Chtimes has undefined behavior
15 // default to Unix Epoch in this case, just in case
17 if atime.Before(unixMinTime) || atime.After(unixMaxTime) {
21 if mtime.Before(unixMinTime) || mtime.After(unixMaxTime) {
25 if err := os.Chtimes(name, atime, mtime); err != nil {
29 // Take platform specific action for setting create time.
30 if err := setCTime(name, mtime); err != nil {