mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
backends: make NewObject return fs.ErrorIsDir if possible
This changes the interface to NewObject so that if NewObject is called on a directory then it should return fs.ErrorIsDir if possible without doing any extra work, otherwise fs.ErrorObjectNotFound. Tested on integration test server with: go run integration-test.go -tests backend -run TestIntegration/FsMkdir/FsPutFiles/FsNewObjectDir -branch fix-stat -maxtries 1
This commit is contained in:
1
fs/fs.go
1
fs/fs.go
@@ -37,6 +37,7 @@ var (
|
||||
ErrorListAborted = errors.New("list aborted")
|
||||
ErrorListBucketRequired = errors.New("bucket or container name is needed in remote")
|
||||
ErrorIsFile = errors.New("is a file not a directory")
|
||||
ErrorIsDir = errors.New("is a directory not a file")
|
||||
ErrorNotAFile = errors.New("is not a regular file")
|
||||
ErrorNotDeleting = errors.New("not deleting files as there were IO errors")
|
||||
ErrorNotDeletingDirs = errors.New("not deleting directories as there were IO errors")
|
||||
|
||||
Reference in New Issue
Block a user