summaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c10
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