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

Method deleteFile

src/SFML/Network/Sftp.cpp:1115–1134  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1113
1114////////////////////////////////////////////////////////////
1115Sftp::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////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 4

pathToUtf8Function · 0.85
makeErrorFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected