Commit | Line | Data |
---|---|---|
2117e02e MW |
1 | #include "subfd.h" |
2 | #include "substdio.h" | |
3 | #include "error.h" | |
4 | #include "exit.h" | |
5 | ||
6 | void die(s) char *s; { substdio_putsflush(subfderr,s); _exit(111); } | |
7 | ||
8 | void main(argc,argv) | |
9 | int argc; | |
10 | char **argv; | |
11 | { | |
12 | umask(077); | |
13 | if (!argv[1]) die("usage: maildirmake name\n"); | |
14 | if (mkdir(argv[1],0700)) | |
15 | if (errno == error_exist) die("fatal: directory already exists\n"); | |
16 | else die("fatal: unable to mkdir\n"); | |
17 | if (chdir(argv[1])) die("fatal: unable to chdir\n"); | |
18 | if (mkdir("tmp",0700)) die("fatal: unable to make tmp/ subdir\n"); | |
19 | if (mkdir("new",0700)) die("fatal: unable to make new/ subdir\n"); | |
20 | if (mkdir("cur",0700)) die("fatal: unable to make cur/ subdir\n"); | |
21 | _exit(0); | |
22 | } |