js8call/fileutils.cpp
2020-06-05 11:09:00 -04:00

12 lines
236 B
C++

#include "fileutils.h"
void flushFileBuffer(const QFile &f){
#ifdef Q_OS_WIN
FlushFileBuffers(reinterpret_cast<HANDLE>(f.handle()));
#elif _POSIX_SYNCHRONIZED_IO > 0
fdatasync(f.handle());
#else
fsync(f.handle());
#endif
}