///////////////////////////////////////////////////////
| 1029 | |
| 1030 | //////////////////////////////////////////////////////////// |
| 1031 | Sftp::Result Sftp::deleteDirectory(const std::filesystem::path& path, const TimeoutWithPredicate& timeout) |
| 1032 | { |
| 1033 | const auto pathString = pathToUtf8(path); |
| 1034 | const auto result = m_impl->waitForOperationComplete( |
| 1035 | [&] |
| 1036 | { |
| 1037 | return libssh2_sftp_rmdir_ex(m_impl->sftpSession.get(), |
| 1038 | pathString.data(), |
| 1039 | static_cast<unsigned int>(pathString.size())); |
| 1040 | }, |
| 1041 | timeout); |
| 1042 | |
| 1043 | if (result == LIBSSH2_ERROR_EAGAIN) |
| 1044 | return Result(Result::Value::Timeout); |
| 1045 | |
| 1046 | if (result < 0) |
| 1047 | return makeError(m_impl->ssh2Session.get(), m_impl->sftpSession.get()); |
| 1048 | |
| 1049 | return Result(Result::Value::Success); |
| 1050 | } |
| 1051 | |
| 1052 | |
| 1053 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected