File: maildirmake.c

package info (click to toggle)
qmail 1.03-49.2
  • links: PTS
  • area: non-free
  • in suites: squeeze
  • size: 4,380 kB
  • ctags: 2,091
  • sloc: ansic: 16,302; makefile: 2,447; sh: 771; perl: 449
file content (24 lines) | stat: -rw-r--r-- 713 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "strerr.h"
#include "exit.h"

#define FATAL "maildirmake: fatal: "

void main(argc,argv)
int argc;
char **argv;
{
  umask(077);
  if (!argv[1])
    strerr_die1x(100,"maildirmake: usage: maildirmake name");
  if (mkdir(argv[1],0700) == -1)
    strerr_die4sys(111,FATAL,"unable to mkdir ",argv[1],": ");
  if (chdir(argv[1]) == -1)
    strerr_die4sys(111,FATAL,"unable to chdir to ",argv[1],": ");
  if (mkdir("tmp",0700) == -1)
    strerr_die4sys(111,FATAL,"unable to mkdir ",argv[1],"/tmp: ");
  if (mkdir("new",0700) == -1)
    strerr_die4sys(111,FATAL,"unable to mkdir ",argv[1],"/new: ");
  if (mkdir("cur",0700) == -1)
    strerr_die4sys(111,FATAL,"unable to mkdir ",argv[1],"/cur: ");
  _exit(0);
}