Clarify portability and main program.
[python/dscho.git] / Mac / Compat / mkdir.c
blob3c35eb0ca88c86862aeea073c78d078743a174f3
1 /* Mkdir for the Macintosh.
2 Public domain by Guido van Rossum, CWI, Amsterdam (July 1987).
3 Pathnames must be Macintosh paths, with colons as separators. */
5 #include "macdefs.h"
7 /* Create a directory. */
9 int
10 mkdir(path, mode)
11 char *path;
12 int mode; /* Ignored */
14 HFileParam pb;
16 if (!hfsrunning()) {
17 errno= ENODEV;
18 return -1;
20 pb.ioNamePtr= (StringPtr) Pstring(path);
21 pb.ioVRefNum= 0;
22 pb.ioDirID= 0;
23 if (PBDirCreate((HParmBlkPtr)&pb, FALSE) != noErr) {
24 errno= EACCES;
25 return -1;
27 return 0;