diff --git a/Gomfile b/Gomfile index 34c66254..3ecfe54e 100644 --- a/Gomfile +++ b/Gomfile @@ -10,7 +10,7 @@ gom 'github.com/syndtr/goleveldb/leveldb', :commit => '9888007' gom 'github.com/ugorji/go/codec', :commit => '71c2886f5a673a35f909803f38ece5810165097b' gom 'github.com/wsxiaoys/terminal/color', :commit => '5668e431776a7957528361f90ce828266c69ed08' gom 'code.google.com/p/mxk/go1/flowcontrol', :commit => '5ff2502e2556' -gom 'github.com/mitchellh/goamz/s3', :commit => '3c2b519fc7544563e5a2031cc8bb04b567b1b9bc' +gom 'github.com/mitchellh/goamz/s3', :commit => 'd52d1cf9e63e860748042a0e97e7f670fb725e24' group :test do gom 'launchpad.net/gocheck' diff --git a/s3/public.go b/s3/public.go index 6d3e6617..8f5e059f 100644 --- a/s3/public.go +++ b/s3/public.go @@ -208,5 +208,10 @@ func (storage *PublishedStorage) Filelist(prefix string) ([]string, error) { // RenameFile renames (moves) file func (storage *PublishedStorage) RenameFile(oldName, newName string) error { - panic("not implemented yet") + err := storage.bucket.Copy(filepath.Join(storage.prefix, oldName), filepath.Join(storage.prefix, newName), storage.acl) + if err != nil { + return fmt.Errorf("error copying %s -> %s in %s: %s", oldName, newName, storage, err) + } + + return storage.Remove(oldName) }