Address/memory/thread sanitizer.

This commit is contained in:
Christian Buttner
2024-07-02 20:22:54 +02:00
committed by Christoffer Lerno
parent d54468d7ed
commit 59ed118e66
24 changed files with 788 additions and 137 deletions

View File

@@ -487,6 +487,18 @@ extern int _getdrive(void);
extern int _chdrive(int drive);
#endif
void file_copy_file(const char *src_path, const char *dst_path, bool overwrite)
{
assert(src_path);
assert(dst_path);
#if (_MSC_VER)
CopyFileW(win_utf8to16(src_path), win_utf8to16(dst_path), !overwrite);
#else
const char *cmd = "cp %s %s %s";
execute_cmd(str_printf(cmd, !overwrite ? "--update=none" : "--update=all", src_path, dst_path), true, NULL);
#endif
}
bool file_delete_file(const char *path)
{
assert(path);

View File

@@ -73,6 +73,7 @@ const char* file_expand_path(const char* path);
const char* find_lib_dir(void);
const char *find_rel_exe_dir(const char *dir);
void file_copy_file(const char *src_path, const char *dst_path, bool overwrite);
void file_delete_all_files_in_dir_with_suffix(const char *dir, const char *suffix);
bool file_delete_file(const char *path);
bool file_is_dir(const char *file);