Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

azureblob: fix NewObject on a directory returning "is not a regular file"

Nick Craig-Wood90f3e8e5c093
diff --git a/backend/azureblob/azureblob.go b/backend/azureblob/azureblob.go
index 03894e0f5..09b8c2aa5 100644
--- a/backend/azureblob/azureblob.go
+++ b/backend/azureblob/azureblob.go
@@ -850,7 +850,12 @@ func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *contain
// NewObject finds the Object at remote. If it can't be found
// it returns the error fs.ErrorObjectNotFound.
func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) {
- return f.newObjectWithInfo(ctx, remote, nil)
+ o, err := f.newObjectWithInfo(ctx, remote, nil)
+ if err == fs.ErrorNotAFile {
+ // The blob is a directory
+ return nil, fs.ErrorObjectNotFound
+ }
+ return o, err
}
// getBlobSVC creates a blob client