2024-10-01 01:38:18 +08:00
|
|
|
//go:build aix || freebsd || darwin || dragonfly || openbsd || linux
|
|
|
|
|
// +build aix freebsd darwin dragonfly openbsd linux
|
|
|
|
|
|
|
|
|
|
package localfs
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
"github.com/pkg/sftp/v2/encoding/ssh/filexfer/openssh"
|
|
|
|
|
"github.com/pkg/sftp/v2/localfs/statvfs"
|
|
|
|
|
)
|
|
|
|
|
|
2024-11-12 23:37:31 +08:00
|
|
|
// StatVFS implements ssh.StatVFSFileHandler.
|
2024-10-01 01:38:18 +08:00
|
|
|
func (f *File) StatVFS() (*openssh.StatVFSExtendedReplyPacket, error) {
|
|
|
|
|
return statvfs.StatVFS(f.filename)
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-12 23:37:31 +08:00
|
|
|
// StatVFS implements ssh.StatVFSServerHandler.
|
2024-10-01 01:38:18 +08:00
|
|
|
func (s *ServerHandler) StatVFS(_ context.Context, req *openssh.StatVFSExtendedPacket) (*openssh.StatVFSExtendedReplyPacket, error) {
|
|
|
|
|
return statvfs.StatVFS(req.Path)
|
|
|
|
|
}
|