mirror of
https://github.com/rclone/rclone.git
synced 2026-10-10 15:01:37 -04:00
azureblob: fix NewObject on a directory returning "is not a regular file"
On storage accounts with a hierarchical namespace, directories can be read as blobs so NewObject on a directory returned fs.ErrorNotAFile rather than fs.ErrorObjectNotFound.
This commit is contained in:
1 parent
93c2787dc8
commit
90f3e8e5c0
1 file changed
+6
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user