google / skicka

Command-line utility for working with Google Drive. Join the mailing list at https://groups.google.com/forum/#!forum/skicka-users.
Apache License 2.0
1.3k stars 118 forks source link

Close file before setting modification time. Fixes #82 #84

Closed bgrainger closed 9 years ago

bgrainger commented 9 years ago

If writeCloser.Close() is defer'ed, it runs after os.Chtimes which (at least on Windows) causes the modification time to be set to "now" rather than the file modification time from Google Drive.

We now explicitly close the file before setting the modification time (or returning from the function in case of error).

mmp commented 9 years ago

Very nice--looks good!