Debian Codegraph @

icmake/md

raw
1 // md: target should be a series of blank-delimited directories to be created
2 // If an element is a whildcard, the directory will always be created,
3 // using mkdir -p.
4 //
5 // uses: run()
6
7 void md(string target)
8 {
9 int idx;
10 list paths;
11 string dir;
12
13 if (!exists(target))
14 run("mkdir -p " + target);
15 else if (((int)stat(target)[0] & S_IFDIR) == 0)
16 {
17 printf(target + " exists, but is not a directory\n");
18 exit(1);
19 }
20 }
21
22
23
24
25