1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-04 09:33:36 +00:00

Create separate interface for object information.

Take out read-only information about a Fs in a separate struct to limit access.

See discussion at #282.
This commit is contained in:
klauspost
2016-02-18 12:35:25 +01:00
committed by Nick Craig-Wood
parent 85a0f25b95
commit ef06371c93
16 changed files with 190 additions and 95 deletions

View File

@@ -188,7 +188,8 @@ func (r *Run) WriteObjectTo(f fs.Fs, remote, content string, modTime time.Time)
}
for tries := 1; ; tries++ {
in := bytes.NewBufferString(content)
_, err := f.Put(in, remote, modTime, int64(len(content)))
objinfo := fs.NewStaticObjectInfo(remote, modTime, int64(len(content)), true, nil, nil)
_, err := f.Put(in, objinfo)
if err == nil {
break
}