mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
impr: Don't memory map files, never keep a write handle open for long
Closes #592
This commit is contained in:
@@ -8,12 +8,20 @@
|
||||
|
||||
#include <hex/helpers/fs.hpp>
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if defined(OS_MACOS)
|
||||
#include <unistd.h>
|
||||
#include <sys/fcntl.h>
|
||||
|
||||
#define off64_t off_t
|
||||
#define fopen64 fopen
|
||||
#define fseeko64 fseek
|
||||
#define ftello64 ftell
|
||||
#define ftruncate64 ftruncate
|
||||
#elif defined(OS_LINUX)
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
namespace hex::fs {
|
||||
@@ -65,6 +73,8 @@ namespace hex::fs {
|
||||
|
||||
void disableBuffering();
|
||||
|
||||
std::optional<struct stat> getFileInfo();
|
||||
|
||||
private:
|
||||
FILE *m_file;
|
||||
std::fs::path m_path;
|
||||
|
||||
Reference in New Issue
Block a user