mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Address/memory/thread sanitizer.
This commit is contained in:
committed by
Christoffer Lerno
parent
d54468d7ed
commit
59ed118e66
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user