MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / write

Method write

src/common/classes/TempFile.cpp:362–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360//
361
362FB_SIZE_T TempFile::write(offset_t offset, const void* buffer, FB_SIZE_T length)
363{
364 fb_assert(offset <= size);
365 seek(offset);
366#if defined(WIN_NT)
367 DWORD bytes = 0;
368 if (!WriteFile(handle, buffer, length, &bytes, NULL) || bytes != length)
369 {
370 system_error::raise("WriteFile");
371 }
372#else
373 const int bytes = ::write(handle, buffer, length);
374 if (bytes < 0 || FB_SIZE_T(bytes) != length)
375 {
376 system_error::raise("write");
377 }
378#endif
379 position += bytes;
380 if (position > size)
381 size = position;
382 return bytes;
383}
384
385//
386// TempFile::unlink

Callers 2

MsgPrintHelperFunction · 0.45
MsgPrintFunction · 0.45

Calls 1

raiseFunction · 0.85

Tested by

no test coverage detected