MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / WriteFully

Function WriteFully

Bcore/src/main/cpp/android-base/file.cpp:187–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187bool WriteFully(int fd, const void* data, size_t byte_count) {
188 const uint8_t* p = reinterpret_cast<const uint8_t*>(data);
189 size_t remaining = byte_count;
190 while (remaining > 0) {
191 ssize_t n = TEMP_FAILURE_RETRY(write(fd, p, remaining));
192 if (n == -1) return false;
193 p += n;
194 remaining -= n;
195 }
196 return true;
197}
198
199bool RemoveFileIfExists(const std::string& path, std::string* err) {
200 struct stat st;

Callers 1

AppendMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected