1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
/*
* TODO:
* This needs more error-checking
* Chmod directories which have to be group writable
*/
int
main(int argc, char **argv)
{
char *path;
char *tmp;
if (argc > 1)
path = argv[1];
else
path = ".";
asprintf(&tmp, "%s/tmp", path);
mkdir(tmp, 0770);
free(tmp);
asprintf(&tmp, "%s/new", path);
mkdir(tmp, 0770);
free(tmp);
asprintf(&tmp, "%s/work", path);
mkdir(tmp, 0770);
free(tmp);
asprintf(&tmp, "%s/failed", path);
mkdir(tmp, 0770);
free(tmp);
asprintf(&tmp, "%s/done", path);
mkdir(tmp, 0770);
free(tmp);
return 0;
}
|