diff options
-rw-r--r-- | common/os_calls.c | 12 | ||||
-rw-r--r-- | common/os_calls.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/common/os_calls.c b/common/os_calls.c index 4d78887c..366a4832 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -585,6 +585,18 @@ g_file_exist(char* filename) } /*****************************************************************************/ +/* returns non zero if the file was deleted */ +int +g_file_delete(char* filename) +{ +#if defined(_WIN32) + return DeleteFile(filename); +#else + return unlink(filename) != -1; +#endif +} + +/*****************************************************************************/ int g_strlen(char* text) { diff --git a/common/os_calls.h b/common/os_calls.h index 2fd0f6f0..cf26cf20 100644 --- a/common/os_calls.h +++ b/common/os_calls.h @@ -102,6 +102,8 @@ g_set_current_dir(char* dirname); int g_file_exist(char* filename); int +g_file_delete(char* filename); +int g_strlen(char* text); char* g_strcpy(char* dest, char* src); |