filecopy: use modtime as access time

This commit is contained in:
gutmet 2019-02-20 00:24:34 +01:00
parent 8e33b7728d
commit ab2b1e8f6a

View File

@ -32,7 +32,6 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"time"
) )
// Copy copies src to dest, doesn't matter if src is a directory or a file // Copy copies src to dest, doesn't matter if src is a directory or a file
@ -66,7 +65,7 @@ func filecopy(src, dest string, info os.FileInfo) error {
if err = os.Chmod(f.Name(), info.Mode()); err != nil { if err = os.Chmod(f.Name(), info.Mode()); err != nil {
return err return err
} }
if err = os.Chtimes(f.Name(), time.Now().Local(), info.ModTime()); err != nil { if err = os.Chtimes(f.Name(), info.ModTime(), info.ModTime()); err != nil {
return err return err
} }
s, err := os.Open(src) s, err := os.Open(src)