From c2c01c46f1bfc3fd3467063f158297d91111d024 Mon Sep 17 00:00:00 2001 From: "Stephen McQuay (smcquay)" Date: Sun, 22 May 2016 09:50:37 -0700 Subject: [PATCH] update mtime on files as we write them. --- media.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/media.go b/media.go index 6a5743b..fae67c4 100644 --- a/media.go +++ b/media.go @@ -41,6 +41,10 @@ func (m Media) Move(root string) error { return fmt.Errorf("trouble copying file: %v", err) } + if err := os.Chtimes(content, time.Now(), m.Time); err != nil { + return fmt.Errorf("couldn't chtimes for %q: %v", content, err) + } + year := fmt.Sprintf("%04d", m.Time.Year()) month := fmt.Sprintf("%02d", m.Time.Month()) ts := fmt.Sprintf("%d", m.Time.UnixNano())