Created
April 6, 2016 18:21
-
-
Save kkrolikowski/87a1ca61f3d924b9a7b0e36df5e094ab to your computer and use it in GitHub Desktop.
prosta funkcja zakładająca strukturę katalogów
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void mkdirtree(char * path) { | |
int i = 0; | |
char buff[PATH_MAX]; | |
memset(buff, '\0', PATH_MAX); | |
while(*path) { | |
buff[i] = *path; | |
if(*path == '/') { | |
mkdir(buff, 0755); | |
} | |
i++; path++; | |
} | |
mkdir(buff, 0755); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment