mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
fix: Delete dir failed when .DS_Store in it (#17352)
This commit is contained in:
parent
123a2fb3a8
commit
5a21b1f353
@ -2077,6 +2077,18 @@ func (s *xlStorage) deleteFile(basePath, deletePath string, recursive, force boo
|
||||
if isObjectDir {
|
||||
return errFileNotFound
|
||||
}
|
||||
// if we have .DS_Store only on macOS
|
||||
if runtime.GOOS == globalMacOSName {
|
||||
storeFilePath := pathJoin(deletePath, ".DS_Store")
|
||||
_, err := Stat(storeFilePath)
|
||||
// .DS_Store exsits
|
||||
if err == nil {
|
||||
// delete first
|
||||
Remove(storeFilePath)
|
||||
// try again
|
||||
Remove(deletePath)
|
||||
}
|
||||
}
|
||||
// Ignore errors if the directory is not empty. The server relies on
|
||||
// this functionality, and sometimes uses recursion that should not
|
||||
// error on parent directories.
|
||||
|
Loading…
Reference in New Issue
Block a user