MCPcopy Create free account
hub / github.com/SFML/SFML / createDirectory

Method createDirectory

src/SFML/Network/Sftp.cpp:1005–1027  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1003
1004////////////////////////////////////////////////////////////
1005Sftp::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////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 5

pathToUtf8Function · 0.85
makePermissionsFunction · 0.85
makeErrorFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected