Change the interface of SetModTime to return an error - #348

This commit is contained in:
Nick Craig-Wood
2016-03-22 15:56:44 +00:00
parent f469905d07
commit 414b35ea56
12 changed files with 39 additions and 53 deletions
+2 -1
View File
@@ -31,6 +31,7 @@ var (
ErrorCantMove = fmt.Errorf("Can't move object - incompatible remotes")
ErrorCantDirMove = fmt.Errorf("Can't move directory - incompatible remotes")
ErrorDirExists = fmt.Errorf("Can't copy directory - destination already exists")
ErrorCantSetModTime = fmt.Errorf("Can't set modified time")
)
// RegInfo provides information about a filesystem
@@ -142,7 +143,7 @@ type Object interface {
String() string
// SetModTime sets the metadata on the object to set the modification date
SetModTime(time.Time)
SetModTime(time.Time) error
// Open opens the file for read. Call Close() on the returned io.ReadCloser
Open() (io.ReadCloser, error)
+5 -1
View File
@@ -145,7 +145,11 @@ func Equal(src, dst Object) bool {
if !Config.CheckSum {
// Size and hash the same but mtime different so update the
// mtime of the dst object here
dst.SetModTime(srcModTime)
err := dst.SetModTime(srcModTime)
if err != nil {
Stats.Error()
ErrorLog(dst, "Failed to read set modification time: %s", err)
}
}
if hash == HashNone {