Mentioned in #31880
What version of Go are you using (go version)?
$ go version go1.12.7 windows/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
amd64
windows
What did you do?
I wrote a program that copies media files from one location to another and sets the ctime and mtime to the original file timestamp. The program copies a file and changes the date using io.Copy(destFile, srcFile) then calls os.Chtimes(dest, t.AccessTime(), t.ModTime()) to set the dates.
What did you expect to see?
The dates to change to the dates provided... or an error at least. This silently fails.
What did you see instead?
It works appropriately in most cases, but when copying from a windows machine to a Linux SMB server the destination date is always set to now instead of changing to the src date.
It works from Windows to Windows and from Mac to Mac. I haven't tried other combinations yet.
Mentioned in #31880
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
I wrote a program that copies media files from one location to another and sets the ctime and mtime to the original file timestamp. The program copies a file and changes the date using
io.Copy(destFile, srcFile)then callsos.Chtimes(dest, t.AccessTime(), t.ModTime())to set the dates.What did you expect to see?
The dates to change to the dates provided... or an error at least. This silently fails.
What did you see instead?
It works appropriately in most cases, but when copying from a windows machine to a Linux SMB server the destination date is always set to
nowinstead of changing to the src date.It works from Windows to Windows and from Mac to Mac. I haven't tried other combinations yet.