home *** CD-ROM | disk | FTP | other *** search
- /* tamsetup version 1.0, 4/23/90. */
-
- #include <stdio.h>
- #include <sys/file.h>
- #ifdef BSD
- #include <limits.h>
- #endif
- #include <pwd.h>
-
- #ifndef TAMDIR
- #define TAMDIR "/usr/spool/tam"
- #endif
-
- main()
- {
- struct passwd *pw;
- char path[sizeof(TAMDIR) + 11];
- int fd;
-
- if (!(pw = getpwuid(getuid())))
- {
- fprintf(stderr,"tamsetup: fatal: who are you?\n");
- exit(1);
- }
- (void) sprintf(path,"%s/%s",TAMDIR,pw->pw_name);
- if ((fd = open(path,O_WRONLY | O_CREAT | O_EXCL,0600)) == -1)
- {
- perror("tamsetup: fatal: can't create tam spool file");
- exit(2);
- }
- fprintf(stderr,"tamsetup: okay, tam spool file created\n");
- exit(0);
- }
-