mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
FTP: add support for AVBL command
This commit is contained in:
10
vfs/osfs.go
10
vfs/osfs.go
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"github.com/eikenb/pipeat"
|
||||
"github.com/rs/xid"
|
||||
"github.com/shirou/gopsutil/v3/disk"
|
||||
|
||||
"github.com/drakkan/sftpgo/logger"
|
||||
"github.com/drakkan/sftpgo/utils"
|
||||
@@ -477,3 +478,12 @@ func (fs *OsFs) GetMimeType(name string) (string, error) {
|
||||
func (*OsFs) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetAvailableDiskSize return the available size for the specified path
|
||||
func (*OsFs) GetAvailableDiskSize(dirName string) (int64, error) {
|
||||
usage, err := disk.Usage(dirName)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return int64(usage.Free), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user