///////////////////////////////////////////////////////
| 1003 | |
| 1004 | //////////////////////////////////////////////////////////// |
| 1005 | Sftp::Result Sftp::createDirectory(const std::filesystem::path& path, |
| 1006 | std::filesystem::perms permissions, |
| 1007 | const TimeoutWithPredicate& timeout) |
| 1008 | { |
| 1009 | const auto pathString = pathToUtf8(path); |
| 1010 | const auto result = m_impl->waitForOperationComplete( |
| 1011 | [&] |
| 1012 | { |
| 1013 | return libssh2_sftp_mkdir_ex(m_impl->sftpSession.get(), |
| 1014 | pathString.data(), |
| 1015 | static_cast<unsigned int>(pathString.size()), |
| 1016 | makePermissions(permissions)); |
| 1017 | }, |
| 1018 | timeout); |
| 1019 | |
| 1020 | if (result == LIBSSH2_ERROR_EAGAIN) |
| 1021 | return Result(Result::Value::Timeout); |
| 1022 | |
| 1023 | if (result < 0) |
| 1024 | return makeError(m_impl->ssh2Session.get(), m_impl->sftpSession.get()); |
| 1025 | |
| 1026 | return Result(Result::Value::Success); |
| 1027 | } |
| 1028 | |
| 1029 | |
| 1030 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected