diff options
author | Joursoir <chat@joursoir.net> | 2020-09-30 22:10:45 +0300 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2020-09-30 22:10:45 +0300 |
commit | ae1cb7fc44d7abb7ffe47656547cfae40cacdf05 (patch) | |
tree | e3d67059687d8b105202492d6ab0c70186a5dcea /easydir.c | |
parent | ac79cbd424d2339ff34112e142d289a51f90d3a6 (diff) | |
download | lock-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.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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; +} |