Browse Source
Merge pull request #687 from qszxnp/filer2_dir_create_bugfix
bugfix:check Directory attr before create it
pull/610/merge
Chris Lu
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
0 deletions
-
weed/filer2/filer.go
|
@ -80,6 +80,8 @@ func (f *Filer) CreateEntry(entry *Entry) error { |
|
|
if mkdirErr != nil { |
|
|
if mkdirErr != nil { |
|
|
return fmt.Errorf("mkdir %s: %v", dirPath, mkdirErr) |
|
|
return fmt.Errorf("mkdir %s: %v", dirPath, mkdirErr) |
|
|
} |
|
|
} |
|
|
|
|
|
} else if !dirEntry.IsDirectory() { |
|
|
|
|
|
return fmt.Errorf("%s is a file", dirPath) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// cache the directory entry
|
|
|
// cache the directory entry
|
|
|