Skip to content

Instantly share code, notes, and snippets.

@kkrolikowski
Created April 6, 2016 18:21
Show Gist options
  • Save kkrolikowski/87a1ca61f3d924b9a7b0e36df5e094ab to your computer and use it in GitHub Desktop.
Save kkrolikowski/87a1ca61f3d924b9a7b0e36df5e094ab to your computer and use it in GitHub Desktop.
prosta funkcja zakładająca strukturę katalogów
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