| 290 | } |
| 291 | |
| 292 | int CChannelSFTP::Rename(const QString &oldPath, const QString &newPath) |
| 293 | { |
| 294 | int nRet = SSH_FX_OK; |
| 295 | if(!m_SessionSftp) |
| 296 | return SSH_FX_NO_CONNECTION; |
| 297 | nRet = sftp_rename(m_SessionSftp, |
| 298 | oldPath.toStdString().c_str(), |
| 299 | newPath.toStdString().c_str()); |
| 300 | if (nRet != SSH_OK) |
| 301 | { |
| 302 | QString szErr = "Fail: Can't rename: " + QString::number(nRet) |
| 303 | + ssh_get_error(m_Session) |
| 304 | + " " + oldPath + " to " + newPath; |
| 305 | qCritical(log) << szErr; |
| 306 | emit sigError(nRet, szErr); |
| 307 | } else |
| 308 | qDebug(log) << "Rename:" << oldPath << "to" << newPath; |
| 309 | return nRet; |
| 310 | } |
| 311 | |
| 312 | qint64 CChannelSFTP::readData(char *data, qint64 maxlen) |
| 313 | { |