From 2ac10209cc1f3ad01c4edf9a0ff5c6df947154b9 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 28 Apr 2016 01:48:57 -0700 Subject: [PATCH] xl: ListFiles - return sorted files. (#1408) Fixes #1407 --- xl-v1.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xl-v1.go b/xl-v1.go index 3285c4c75..1247b7eda 100644 --- a/xl-v1.go +++ b/xl-v1.go @@ -20,6 +20,7 @@ import ( "fmt" "os" slashpath "path" + "sort" "strings" "sync" @@ -554,6 +555,8 @@ func (xl XL) listFiles(disk StorageAPI, volume, prefix, marker string, recursive break } } + // Sort to make sure we sort entries back properly. + sort.Sort(byFileInfoName(filesInfo)) return filesInfo, eof, nil }