statvfs method

Future<SftpStatVfs> statvfs(
  1. String path
)

Gets the information about a mounted filesystem. path is the pathname of any file within the mounted filesystem.

Note: This is an extension to the SFTP protocol, supported by most openssh servers. A SftpExtensionError is thrown if the server does not support this extension.

See also:

Implementation

Future<SftpStatVfs> statvfs(String path) async {
  await _checkExtension('statvfs@openssh.com', '2');
  final payload = SftpStatVfsRequest(path: path);
  final reply = await _sendExtended(payload);
  if (reply is SftpStatusPacket) throw SftpStatusError.fromStatus(reply);
  if (reply is! SftpExtendedReplyPacket) throw SftpError('Unexpected reply');
  final stat = SftpStatVfsReply.decode(reply.payload);
  return SftpStatVfs.fromReply(stat);
}