mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 08:23:47 +01:00
google cloud storage: Make operations on single files work
This commit is contained in:
parent
a1732c21d8
commit
b72fc69fbe
@ -15,6 +15,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"path"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -139,20 +140,19 @@ func NewFs(name, root string) (fs.Fs, error) {
|
|||||||
if f.root != "" {
|
if f.root != "" {
|
||||||
f.root += "/"
|
f.root += "/"
|
||||||
// Check to see if the object exists
|
// Check to see if the object exists
|
||||||
// FIXME
|
_, err = f.svc.Objects.Get(bucket, directory).Do()
|
||||||
// _, _, err = f.svc.Object(bucket, directory)
|
if err == nil {
|
||||||
// if err == nil {
|
remote := path.Base(directory)
|
||||||
// remote := path.Base(directory)
|
f.root = path.Dir(directory)
|
||||||
// f.root = path.Dir(directory)
|
if f.root == "." {
|
||||||
// if f.root == "." {
|
f.root = ""
|
||||||
// f.root = ""
|
} else {
|
||||||
// } else {
|
f.root += "/"
|
||||||
// f.root += "/"
|
}
|
||||||
// }
|
obj := f.NewFsObject(remote)
|
||||||
// obj := f.NewFsObject(remote)
|
// return a Fs Limited to this object
|
||||||
// // return a Fs Limited to this object
|
return fs.NewLimited(f, obj), nil
|
||||||
// return fs.NewLimited(f, obj), nil
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
return f, nil
|
return f, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user