maildirmake.c
changeset 0 068428edee47
equal deleted inserted replaced
-1:000000000000 0:068428edee47
       
     1 #include "strerr.h"
       
     2 #include "exit.h"
       
     3 
       
     4 #define FATAL "maildirmake: fatal: "
       
     5 
       
     6 void main(argc,argv)
       
     7 int argc;
       
     8 char **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 }