summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-02-21 12:33:50 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-02-21 12:33:50 (GMT)
commit243b29b169f60ac5996615b80c6ef49bb9609580 (patch)
treed51c582909015945d82acb350e727533ebe30e0b
parenta406c7b695cf7e1ac2264f0cfbb866d3eacf3077 (diff)
downloadcpython-243b29b169f60ac5996615b80c6ef49bb9609580.zip
cpython-243b29b169f60ac5996615b80c6ef49bb9609580.tar.gz
cpython-243b29b169f60ac5996615b80c6ef49bb9609580.tar.bz2
Mods by Guido: mkdir 2nd arg optional and remove as alias for unlink.
-rw-r--r--Mac/Modules/macmodule.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/Mac/Modules/macmodule.c b/Mac/Modules/macmodule.c
index 6eac25f..4190db0 100644
--- a/Mac/Modules/macmodule.c
+++ b/Mac/Modules/macmodule.c
@@ -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