mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-10-30 08:07:01 +08:00
Fix: folder with the same name should not be created
This commit is contained in:
@ -107,6 +107,12 @@ func (fs *FileSystem) CreateDirectory(ctx context.Context, fullPath string) erro
|
||||
return ErrPathNotExist
|
||||
}
|
||||
|
||||
// 是否有同名目录
|
||||
b, _ := fs.IsPathExist(fullPath)
|
||||
if b {
|
||||
return ErrFolderExisted
|
||||
}
|
||||
|
||||
// 是否有同名文件
|
||||
if ok, _ := fs.IsFileExist(path.Join(base, dir)); ok {
|
||||
return ErrFileExisted
|
||||
|
||||
Reference in New Issue
Block a user