diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-16 12:12:49 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-16 12:12:49 +0200 |
| commit | c06d284b7016a02d33294be5793febd05e52839d (patch) | |
| tree | 18a9f688f32aa31c6569c969e353a5eb83ea3748 /src/utils.c | |
| parent | c5ca719d68731315118a4e269045603a25ff3b79 (diff) | |
Minor changes
Diffstat (limited to 'src/utils.c')
| -rw-r--r-- | src/utils.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c index 909655e..832cc9b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -4,4 +4,14 @@ void mkdirp(char *path){ char buffer[255]="mkdir -p "; strcat(buffer,path); system(buffer); +} + +unsigned char dir_exists(char *path){ + DIR* dir = opendir(path); + if (dir) { + /* Directory exists. */ + closedir(dir); + return 1; + } + return 0; }
\ No newline at end of file |
