]> granicus.if.org Git - python/commitdiff
Mods by Guido: mkdir 2nd arg optional and remove as alias for unlink.
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 21 Feb 1996 12:33:50 +0000 (12:33 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 21 Feb 1996 12:33:50 +0000 (12:33 +0000)
Mac/Modules/macmodule.c

index 6eac25fb836ec992fc538d023ff3998215d05841..4190db0b80c9e764708aaf5e5c64935d843ad93d 100644 (file)
@@ -345,7 +345,18 @@ mac_mkdir(self, args)
        object *self;
        object *args;
 {
-       return mac_strint(args, mkdir);
+       int res;
+       char *path;
+       int mode = 0777; /* Unused */
+       if (!newgetargs(args, "s|i", &path, &mode))
+               return NULL;
+       BGN_SAVE
+       res = mkdir(path, mode);
+       END_SAVE
+       if (res < 0)
+               return mac_error();
+       INCREF(None);
+       return None;
 }
 
 static object *
@@ -545,7 +556,7 @@ static struct methodlist mac_methods[] = {
        {"getcwd",      mac_getcwd},
        {"listdir",     mac_listdir, 0},
        {"lseek",       mac_lseek},
-       {"mkdir",       mac_mkdir},
+       {"mkdir",       mac_mkdir, 1},
        {"open",        mac_open},
        {"read",        mac_read},
        {"rename",      mac_rename},
@@ -553,6 +564,7 @@ static struct methodlist mac_methods[] = {
        {"stat",        mac_stat},
        {"xstat",       mac_xstat},
        {"sync",        mac_sync},
+       {"remove",      mac_unlink},
        {"unlink",      mac_unlink},
        {"write",       mac_write},
 #ifdef MALLOC_DEBUG