update mtime on files as we write them.

This commit is contained in:
sm
2016-05-22 09:55:08 -07:00
parent 53b1be748a
commit c2c01c46f1
+4
View File
@@ -41,6 +41,10 @@ func (m Media) Move(root string) error {
return fmt.Errorf("trouble copying file: %v", err) 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()) year := fmt.Sprintf("%04d", m.Time.Year())
month := fmt.Sprintf("%02d", m.Time.Month()) month := fmt.Sprintf("%02d", m.Time.Month())
ts := fmt.Sprintf("%d", m.Time.UnixNano()) ts := fmt.Sprintf("%d", m.Time.UnixNano())