xl: ListFiles - return sorted files. (#1408)

Fixes #1407
This commit is contained in:
Harshavardhana 2016-04-28 01:48:57 -07:00
parent 5bd6b0b510
commit 2ac10209cc

View File

@ -20,6 +20,7 @@ import (
"fmt" "fmt"
"os" "os"
slashpath "path" slashpath "path"
"sort"
"strings" "strings"
"sync" "sync"
@ -554,6 +555,8 @@ func (xl XL) listFiles(disk StorageAPI, volume, prefix, marker string, recursive
break break
} }
} }
// Sort to make sure we sort entries back properly.
sort.Sort(byFileInfoName(filesInfo))
return filesInfo, eof, nil return filesInfo, eof, nil
} }