9 ** Try to make one directory. Return false on error.
11 static bool MakeDir(char *Name)
15 if (mkdir(Name, GROUPDIR_MODE) >= 0) {
19 /* See if it failed because it already exists. */
20 if (stat(Name, &Sb) >= 0 && S_ISDIR(Sb.st_mode)) {
29 ** Given a directory, comp/foo/bar, create that directory and all
30 ** intermediate directories needed. Return true if ok, else false.
32 bool MakeDirectory(char *Name, bool Recurse)
37 /* Optimize common case -- parent almost always exists. */
44 /* Try to make each of comp and comp/foo in turn. */
45 for (p = (Name[0] == '/') ? &Name[1] : Name; *p; p++)