Support creating directories on erasure coded backend (#5443)

This PR continues from #5049 where we started supporting
directories for erasure coded backend
This commit is contained in:
Harshavardhana
2018-01-29 18:43:13 -08:00
committed by Nitish Tiwari
parent 45c35b3544
commit 3ea28e9771
11 changed files with 155 additions and 72 deletions

View File

@@ -17,6 +17,7 @@
package cmd
import (
"path"
"sync"
humanize "github.com/dustin/go-humanize"
@@ -221,6 +222,11 @@ func cleanupDir(storage StorageAPI, volume, dirPath string) error {
return errors.Trace(err)
} // else on success..
// Entry path is empty, just delete it.
if len(entries) == 0 {
return errors.Trace(storage.DeleteFile(volume, path.Clean(entryPath)))
}
// Recurse and delete all other entries.
for _, entry := range entries {
if err = delFunc(pathJoin(entryPath, entry)); err != nil {