3 static char elsieid
[] = "@(#)emkdir.c 8.23";
4 #endif /* !defined NOID */
5 #endif /* !defined lint */
13 extern char * imalloc
P((int n
));
14 extern void ifree
P((char * p
));
18 register const char * name
;
20 register char * result
;
26 result
= imalloc((int) (4 * strlen(name
) + 3));
32 while ((c
= *name
++) != '\0')
40 #endif /* defined unix */
42 while ((c
= *name
++) != '\0')
46 #endif /* !defined unix */
57 register const char * format
;
58 register char * command
;
59 register char * qname
;
61 if ((qname
= quoted(name
)) == NULL
)
64 format
= "mkdir 2>&- %s && chmod 2>&- %o %s";
65 #endif /* defined unix */
68 #endif /* !defined unix */
69 command
= imalloc((int) (strlen(format
) + 2 * strlen(qname
) + 20 + 1));
70 if (command
== NULL
) {
74 (void) sprintf(command
, format
, qname
, mode
, qname
);
76 result
= system(command
);
78 return (result
== 0) ? 0 : -1;
82 ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
85 #endif /* !defined emkdir */