MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / FileCommit

Function FileCommit

src/commons/util/util.cpp:735–749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

733}
734
735void FileCommit(FILE* fileout) {
736 fflush(fileout); // harmless if redundantly called
737#ifdef WIN32
738 HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(fileout));
739 FlushFileBuffers(hFile);
740#else
741#if defined(__linux__) || defined(__NetBSD__)
742 fdatasync(fileno(fileout));
743#elif defined(__APPLE__) && defined(F_FULLFSYNC)
744 fcntl(fileno(fileout), F_FULLFSYNC, 0);
745#else
746 fsync(fileno(fileout));
747#endif
748#endif
749}
750
751bool TruncateFile(FILE* file, unsigned int length) {
752#if defined(WIN32)

Callers 4

FlushBlockFileFunction · 0.85
WriteMethod · 0.85
WriteBlockToDiskFunction · 0.85
WriteToDiskMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected