aboutsummaryrefslogtreecommitdiffstats
path: root/easydir.c
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2020-09-30 22:10:45 +0300
committerJoursoir <chat@joursoir.net>2020-09-30 22:10:45 +0300
commitae1cb7fc44d7abb7ffe47656547cfae40cacdf05 (patch)
treee3d67059687d8b105202492d6ab0c70186a5dcea /easydir.c
parentac79cbd424d2339ff34112e142d289a51f90d3a6 (diff)
downloadlock-password-ae1cb7fc44d7abb7ffe47656547cfae40cacdf05.tar.gz
lock-password-ae1cb7fc44d7abb7ffe47656547cfae40cacdf05.tar.bz2
lock-password-ae1cb7fc44d7abb7ffe47656547cfae40cacdf05.zip
refactor input in -egi
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;
+}