diff --git a/cmd/xl-storage.go b/cmd/xl-storage.go index af148f8c6..f9726d7d6 100644 --- a/cmd/xl-storage.go +++ b/cmd/xl-storage.go @@ -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.