Skip to content

Commit

Permalink
Merge pull request minio#1046 from harshavardhana/bucket-not-empty
Browse files Browse the repository at this point in the history
deleteBucket: Directory not empty error on windows is "directory is n…
  • Loading branch information
Harshavardhana committed Jan 26, 2016
2 parents 35d4521 + 2ec9b16 commit 67a70eb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/fs/fs-bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ func (fs Filesystem) DeleteBucket(bucket string) *probe.Error {
return probe.NewError(e)
}
if e := os.Remove(bucketDir); e != nil {
// On windows the string is slightly different, handle it here.
if strings.Contains(e.Error(), "directory is not empty") {
return probe.NewError(BucketNotEmpty{Bucket: bucket})
}
// Hopefully for all other operating systems, this is
// assumed to be consistent.
if strings.Contains(e.Error(), "directory not empty") {
return probe.NewError(BucketNotEmpty{Bucket: bucket})
}
Expand Down

0 comments on commit 67a70eb

Please sign in to comment.