stat method

Future<SftpFileAttrs> stat(
  1. String path, {
  2. bool followLink = true,
})

Gets the attributes of the file at path.

Implementation

Future<SftpFileAttrs> stat(String path, {bool followLink = true}) async {
  final reply = followLink ? await _sendStat(path) : await _sendLStat(path);
  if (reply is SftpAttrsPacket) return reply.attrs;
  if (reply is! SftpStatusPacket) throw SftpError('Unexpected reply');
  throw SftpStatusError.fromStatus(reply);
}