Compare commits

...
3 Commits
Author SHA1 Message Date
Nick Craig-Wood 37b2274e10 Version 1.01 2014-07-04 21:15:27 +01:00
Nick Craig-Wood 91cfbd4146 drive: fix transfer of big files using up lots of memory - fixes #5
This was done by making a seekWrapper which wraps an io.Reader with a
basic Seek for code.google.com/p/google-api-go-client/googleapi to
detect the length.  Without this the getReaderSize function reads the
entire file into memory to find its length.
2014-07-04 17:17:21 +01:00
Nick Craig-Wood d4817399ff Fix release procedure 2014-07-03 22:01:25 +01:00
6 changed files with 52 additions and 23 deletions

No files matched your search

+3 -1
View File
@@ -214,8 +214,10 @@ Bugs
Changelog
---------
* v1.01 - 2014-07-04
* drive: fix transfer of big files using up lots of memory
* v1.00 - 2014-07-03
* drive: fix whole second dates - fixes #4
* drive: fix whole second dates
* v0.99 - 2014-06-26
* Fix --dry-run not working
* Make compatible with go 1.1
+18 -18
View File
@@ -2,34 +2,34 @@
title: "Rclone downloads"
description: "Download rclone binaries for your OS."
type: page
date: "2014-07-03"
date: "2014-07-04"
---
Rclone Download v1.00
Rclone Download v1.01
=====================
* Windows
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.00-windows-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.00-windows-amd64.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.01-windows-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.01-windows-amd64.zip)
* OSX
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.00-osx-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.00-osx-amd64.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.01-osx-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.01-osx-amd64.zip)
* Linux
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.00-linux-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.00-linux-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-v1.00-linux-arm.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.01-linux-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.01-linux-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-v1.01-linux-arm.zip)
* FreeBSD
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.00-freebsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.00-freebsd-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-v1.00-freebsd-arm.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.01-freebsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.01-freebsd-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-v1.01-freebsd-arm.zip)
* NetBSD
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.00-netbsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.00-netbsd-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-v1.00-netbsd-arm.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.01-netbsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.01-netbsd-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-v1.01-netbsd-arm.zip)
* OpenBSD
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.00-openbsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.00-openbsd-amd64.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.01-openbsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.01-openbsd-amd64.zip)
* Plan 9
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.00-plan9-386.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.01-plan9-386.zip)
Older downloads can be found [here](http://downloads.rclone.org/)
+27
View File
@@ -22,6 +22,7 @@ import (
"log"
"mime"
"net/http"
"os"
"path"
"strings"
"sync"
@@ -689,6 +690,30 @@ func (f *FsDrive) ListDir() fs.DirChan {
return out
}
// seekWrapper wraps an io.Reader with a basic Seek for
// code.google.com/p/google-api-go-client/googleapi
// to detect the length (see getReaderSize function)
type seekWrapper struct {
in io.Reader
size int64
}
// Read bytes from the object - see io.Reader
func (file *seekWrapper) Read(p []byte) (n int, err error) {
return file.in.Read(p)
}
// Seek - minimal implementation for Google Drive's length detection
func (file *seekWrapper) Seek(offset int64, whence int) (int64, error) {
switch whence {
case os.SEEK_CUR:
return 0, nil
case os.SEEK_END:
return file.size, nil
}
return 0, nil
}
// Put the object
//
// This assumes that the object doesn't not already exists - if you
@@ -725,6 +750,7 @@ func (f *FsDrive) Put(in io.Reader, remote string, modTime time.Time, size int64
}
// Make the API request to upload metadata and file data.
in = &seekWrapper{in: in, size: size}
info, err = f.svc.Files.Insert(info).Media(in).Do()
if err != nil {
return o, fmt.Errorf("Upload failed: %s", err)
@@ -926,6 +952,7 @@ func (o *FsObjectDrive) Update(in io.Reader, modTime time.Time, size int64) erro
}
// Make the API request to upload metadata and file data.
in = &seekWrapper{in: in, size: size}
info, err := o.drive.svc.Files.Update(info.Id, info).SetModifiedDate(true).Media(in).Do()
if err != nil {
return fmt.Errorf("Update failed: %s", err)
+2 -2
View File
@@ -54,11 +54,11 @@ Making a release
* ./rclonetest /tmp/z
* cd ..
* make tag
* edit README.md Changelog
* edit README.md
* git commit version.go rclonetest/version.go README.md docs/content/downloads.md
* make retag
* . ~/bin/go-cross
* make cross
* make upload
* make upload_website
* git push --tags
* git push --tags origin master
+1 -1
View File
@@ -1,3 +1,3 @@
package main
const Version = "v1.00"
const Version = "v1.01"
+1 -1
View File
@@ -1,3 +1,3 @@
package main
const Version = "v1.00"
const Version = "v1.01"