listObjects: do not do stat during readdir()

* listObjects: improve response time by not doing stat during readDir() operation.

* listObjects: Add windows support.

* listObjects: Readdir() in batches to conserve memory. Add solaris build.

* listObjects: cleanup code.
This commit is contained in:
Krishna Srinivas
2016-04-05 05:57:55 +05:30
committed by Harshavardhana
parent 7623e0f8e8
commit 85ab1df5a8
9 changed files with 473 additions and 376 deletions
+17
View File
@@ -33,6 +33,23 @@ import (
"github.com/minio/minio/pkg/probe"
)
// isDirEmpty - returns whether given directory is empty or not.
func isDirEmpty(dirname string) (status bool, err error) {
f, err := os.Open(dirname)
if err == nil {
defer f.Close()
if _, err = f.Readdirnames(1); err == io.EOF {
status = true
err = nil
}
}
return
}
/// Object Operations
// GetObject - GET object