mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
api: Various fixes.
- limit list buckets to limit only 100 buckets, all uppercase buckets
are now lowercase and work transparently with all calls.
- Change disk.Stat to disk.GetInfo and return back disk.Info{} struct.
- Introduce new ioutils package which implements ReadDirN(path, n),
ReadDirNamesN(path, n)
This commit is contained in:
committed by
Harshavardhana
parent
432a073e6b
commit
497f13d733
@@ -22,19 +22,19 @@ import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// Stat returns total and free bytes available in a directory, e.g. `/`.
|
||||
func Stat(path string) (statfs StatFS, err error) {
|
||||
// GetInfo returns total and free bytes available in a directory, e.g. `/`.
|
||||
func GetInfo(path string) (info Info, err error) {
|
||||
s := syscall.Statfs_t{}
|
||||
err = syscall.Statfs(path, &s)
|
||||
if err != nil {
|
||||
return StatFS{}, err
|
||||
return Info{}, err
|
||||
}
|
||||
statfs = StatFS{}
|
||||
statfs.Total = int64(s.Bsize) * int64(s.Blocks)
|
||||
statfs.Free = int64(s.Bsize) * int64(s.Bfree)
|
||||
statfs.FSType, err = getFSType(path)
|
||||
info = Info{}
|
||||
info.Total = int64(s.Bsize) * int64(s.Blocks)
|
||||
info.Free = int64(s.Bsize) * int64(s.Bfree)
|
||||
info.FSType, err = getFSType(path)
|
||||
if err != nil {
|
||||
return StatFS{}, err
|
||||
return Info{}, err
|
||||
}
|
||||
return statfs, nil
|
||||
return info, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user