1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-06 18:43:50 +00:00

Factor Put() methods into generic Copy() function

This commit is contained in:
Nick Craig-Wood
2013-01-10 21:58:46 +00:00
parent 38ce4c3629
commit 555ab5001e
6 changed files with 61 additions and 98 deletions

View File

@@ -62,13 +62,13 @@ func Copier(in FsObjectsChan, fdst Fs, wg *sync.WaitGroup) {
defer wg.Done()
for src := range in {
stats.Transferring(src)
fdst.Put(src)
Copy(fdst, src)
stats.DoneTransferring(src)
}
}
// Copies fsrc into fdst
func Copy(fdst, fsrc Fs) {
func CopyFs(fdst, fsrc Fs) {
err := fdst.Mkdir()
if err != nil {
stats.Error()
@@ -351,7 +351,7 @@ var Commands = []Command{
MD5SUM. Doesn't delete files from the destination.
`,
Copy,
CopyFs,
2, 2,
},
{