google cloud storage: Make operations on single files work

This commit is contained in:
Nick Craig-Wood 2014-07-14 10:45:28 +01:00
parent a1732c21d8
commit b72fc69fbe

View File

@ -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
} }