summaryrefslogtreecommitdiffstats
path: root/maildirmake.c
diff options
context:
space:
mode:
Diffstat (limited to 'maildirmake.c')
-rw-r--r--maildirmake.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/maildirmake.c b/maildirmake.c
new file mode 100644
index 0000000..9863fef
--- /dev/null
+++ b/maildirmake.c
@@ -0,0 +1,24 @@
1#include "strerr.h"
2#include "exit.h"
3
4#define FATAL "maildirmake: fatal: "
5
6void main(argc,argv)
7int argc;
8char **argv;
9{
10 umask(077);
11 if (!argv[1])
12 strerr_die1x(100,"maildirmake: usage: maildirmake name");
13 if (mkdir(argv[1],0700) == -1)
14 strerr_die4sys(111,FATAL,"unable to mkdir ",argv[1],": ");
15 if (chdir(argv[1]) == -1)
16 strerr_die4sys(111,FATAL,"unable to chdir to ",argv[1],": ");
17 if (mkdir("tmp",0700) == -1)
18 strerr_die4sys(111,FATAL,"unable to mkdir ",argv[1],"/tmp: ");
19 if (mkdir("new",0700) == -1)
20 strerr_die4sys(111,FATAL,"unable to mkdir ",argv[1],"/new: ");
21 if (mkdir("cur",0700) == -1)
22 strerr_die4sys(111,FATAL,"unable to mkdir ",argv[1],"/cur: ");
23 _exit(0);
24}