rename method

Future<void> rename(
  1. String oldPath,
  2. String newPath
)

Renames a file or directory from oldPath to newPath.

Implementation

Future<void> rename(String oldPath, String newPath) async {
  final reply = await _sendRename(oldPath, newPath);
  if (reply is! SftpStatusPacket) throw SftpError('Unexpected reply');
  SftpStatusError.check(reply);
}