diff options
author | Joursoir <chat@joursoir.net> | 2020-10-28 10:17:47 +0000 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2020-10-28 10:17:47 +0000 |
commit | c992bb4c7cc230eff246f5368b7fc765750eec5b (patch) | |
tree | 5ac830807bf9698123979e48512af9f4327b305e /easydir.c | |
parent | 101dd376b32c2cd12640e81b93c2f30975baac7f (diff) | |
download | lock-password-c992bb4c7cc230eff246f5368b7fc765750eec5b.tar.gz lock-password-c992bb4c7cc230eff246f5368b7fc765750eec5b.tar.bz2 lock-password-c992bb4c7cc230eff246f5368b7fc765750eec5b.zip |
feature: move command
Diffstat (limited to 'easydir.c')
-rw-r--r-- | easydir.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -31,11 +31,12 @@ int checkFileExist(char *path_to_file) { FILE *pFile; - pFile = fopen(path_to_file, "r"); + pFile = fopen(path_to_file, "r+"); // r+ so that errno can equal EISDIR if(pFile == NULL) { - if(errno == ENOENT) { // file doesn't exist + if(errno == ENOENT) // file doesn't exist return 0; - } + if(errno == EISDIR) // it's directory + return 2; else callError(120); } fclose(pFile); |