mirror of
https://github.com/pgsty/minio.git
synced 2026-07-21 05:00:22 +03:00
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:
committed by
Harshavardhana
parent
7623e0f8e8
commit
85ab1df5a8
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user