///////////////////////////////////////////////////////
| 1113 | |
| 1114 | //////////////////////////////////////////////////////////// |
| 1115 | Sftp::Result Sftp::deleteFile(const std::filesystem::path& path, const TimeoutWithPredicate& timeout) |
| 1116 | { |
| 1117 | const auto pathString = pathToUtf8(path); |
| 1118 | const auto result = m_impl->waitForOperationComplete( |
| 1119 | [&] |
| 1120 | { |
| 1121 | return libssh2_sftp_unlink_ex(m_impl->sftpSession.get(), |
| 1122 | pathString.data(), |
| 1123 | static_cast<unsigned int>(pathString.size())); |
| 1124 | }, |
| 1125 | timeout); |
| 1126 | |
| 1127 | if (result == LIBSSH2_ERROR_EAGAIN) |
| 1128 | return Result(Result::Value::Timeout); |
| 1129 | |
| 1130 | if (result < 0) |
| 1131 | return makeError(m_impl->ssh2Session.get(), m_impl->sftpSession.get()); |
| 1132 | |
| 1133 | return Result(Result::Value::Success); |
| 1134 | } |
| 1135 | |
| 1136 | |
| 1137 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected