"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
local: Make sure info is never nil
Nick Craig-Woodf7652db4f10f
diff --git a/local/local.go b/local/local.goindex 11a7b11e3..7e4c82280 100644--- a/local/local.go+++ b/local/local.go@@ -38,7 +38,7 @@ type FsObjectLocal struct {local fs.Fs // The Fs this object is part ofremote string // The remote pathpath string // The local path- info os.FileInfo // Interface for file info+ info os.FileInfo // Interface for file info (always present)md5sum string // the md5sum of the object or "" if not calculated}@@ -175,9 +175,13 @@ func (f *FsLocal) ListDir() fs.DirChan {// Puts the FsObject to the local filesystemfunc (f *FsLocal) Put(in io.Reader, remote string, modTime time.Time, size int64) (fs.Object, error) {dstPath := filepath.Join(f.root, remote)- // Temporary FsObject under construction- fs := &FsObjectLocal{local: f, remote: remote, path: dstPath}- return fs, fs.Update(in, modTime, size)+ // Temporary FsObject under construction - info filled in by Update()+ o := &FsObjectLocal{local: f, remote: remote, path: dstPath}+ err := o.Update(in, modTime, size)+ if err != nil {+ return nil, err+ }+ return o, nil}// Mkdir creates the directory if it doesn't exist@@ -403,7 +407,9 @@ func (o *FsObjectLocal) Update(in io.Reader, modTime time.Time, size int64) erro// Set the mtimeo.SetModTime(modTime)- return nil++ // ReRead info now that we have finished+ return o.lstat()}// Stat a FsObject into info