mirror of
https://github.com/minio/minio.git
synced 2025-11-10 14:09:48 -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
@@ -23,11 +23,11 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// Stat returns total and free bytes available in a directory, e.g. `C:\`.
|
||||
// GetInfo returns total and free bytes available in a directory, e.g. `C:\`.
|
||||
// It returns free space available to the user (including quota limitations)
|
||||
//
|
||||
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa364937(v=vs.85).aspx
|
||||
func Stat(path string) (statfs StatFS, err error) {
|
||||
func GetInfo(path string) (info Info, err error) {
|
||||
dll := syscall.MustLoadDLL("kernel32.dll")
|
||||
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa364937(v=vs.85).aspx
|
||||
// Retrieves information about the amount of space that is available on a disk volume,
|
||||
@@ -50,9 +50,9 @@ func Stat(path string) (statfs StatFS, err error) {
|
||||
uintptr(unsafe.Pointer(&lpFreeBytesAvailable)),
|
||||
uintptr(unsafe.Pointer(&lpTotalNumberOfBytes)),
|
||||
uintptr(unsafe.Pointer(&lpTotalNumberOfFreeBytes)))
|
||||
statfs = StatFS{}
|
||||
statfs.Total = int64(lpTotalNumberOfBytes)
|
||||
statfs.Free = int64(lpFreeBytesAvailable)
|
||||
statfs.FSType = getFSType(path)
|
||||
return statfs, nil
|
||||
info = Info{}
|
||||
info.Total = int64(lpTotalNumberOfBytes)
|
||||
info.Free = int64(lpFreeBytesAvailable)
|
||||
info.FSType = getFSType(path)
|
||||
return info, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user