MCPcopy Create free account
hub / github.com/Niko1221/Strata / write_all

Method write_all

engine/src/core/conversation_file.cpp:213–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211 bool is_open() const { return h_ != INVALID_HANDLE_VALUE; }
212 bool direct() const { return false; }
213 bool write_all(const uint8_t* p, size_t n) {
214 while (n) {
215 DWORD w = 0;
216 const DWORD want = (DWORD) std::min<size_t>(n, size_t(1) << 30);
217 if (!WriteFile(h_, p, want, &w, nullptr) || w == 0) { { const DWORD c_ = GetLastError(); kind_ = win_kind(c_); error_ = last_error(c_); } return false; }
218 p += w; n -= w;
219 }
220 return true;
221 }
222 // bytes read, 0 at the end of the file, -1 on error
223 long long read_some(uint8_t* p, size_t n) {
224 DWORD r = 0;

Callers 10

valid_two_tensor_shardFunction · 0.80
finishMethod · 0.80
drainMethod · 0.80
http_request_bodyFunction · 0.80
ureq_getFunction · 0.80
answer_withFunction · 0.80
write_sessionFunction · 0.80
respondFunction · 0.80

Calls 4

win_kindFunction · 0.85
last_errorFunction · 0.85
errno_kindFunction · 0.85
writeFunction · 0.50

Tested by 3

valid_two_tensor_shardFunction · 0.64