Merge pull request #687 from qszxnp/filer2_dir_create_bugfix

bugfix:check Directory attr  before create it
This commit is contained in:
Chris Lu 2018-07-12 01:16:49 -07:00 committed by GitHub
commit cf5739946b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,6 +80,8 @@ func (f *Filer) CreateEntry(entry *Entry) error {
if mkdirErr != nil {
return fmt.Errorf("mkdir %s: %v", dirPath, mkdirErr)
}
} else if !dirEntry.IsDirectory() {
return fmt.Errorf("%s is a file", dirPath)
}
// cache the directory entry