From 97b1407d916c4da6b25983e901cef231659034a5 Mon Sep 17 00:00:00 2001 From: jsorg71 Date: Sat, 5 Nov 2005 23:51:10 +0000 Subject: [PATCH] added file delete --- common/os_calls.c | 12 ++++++++++++ common/os_calls.h | 2 ++ 2 files changed, 14 insertions(+) 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 @@ -584,6 +584,18 @@ g_file_exist(char* filename) #endif } +/*****************************************************************************/ +/* 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);