aboutsummaryrefslogtreecommitdiffstats
path: root/easydir.c
diff options
context:
space:
mode:
Diffstat (limited to 'easydir.c')
-rw-r--r--easydir.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/easydir.c b/easydir.c
index a4ece76..0c8c387 100644
--- a/easydir.c
+++ b/easydir.c
@@ -111,3 +111,19 @@ int delete_emptydir(char *dir_path)
return 1;
}
+
+int checkFileExist(char *path_to_file)
+{
+ FILE *pFile;
+
+ pFile = fopen(path_to_file, "r");
+ if(pFile == NULL) {
+ if(errno == ENOENT) { // file doesn't exist
+ return 0;
+ }
+ else call_error(120);
+ }
+ fclose(pFile);
+
+ return 1;
+}