renameFileOrDirectory method

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

Implementation

Future<void> renameFileOrDirectory(String oldPath, String newPath) async {
  try {
    await fileOperations.renameFileOrDirectory(oldPath, newPath);
    pendingRenameFrom = null;
    sendResponse('250 Requested file action completed successfully');
  } catch (e) {
    pendingRenameFrom = null;
    sendResponse('550 Failed to rename');
    logger.generalLog('Error renaming $oldPath to $newPath: $e');
  }
}