mirror of
https://github.com/python/cpython.git
synced 2025-11-08 13:42:22 +00:00
Mods by Guido: mkdir 2nd arg optional and remove as alias for unlink.
This commit is contained in:
parent
a406c7b695
commit
243b29b169
1 changed files with 14 additions and 2 deletions
|
|
@ -345,7 +345,18 @@ mac_mkdir(self, args)
|
||||||
object *self;
|
object *self;
|
||||||
object *args;
|
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 *
|
static object *
|
||||||
|
|
@ -545,7 +556,7 @@ static struct methodlist mac_methods[] = {
|
||||||
{"getcwd", mac_getcwd},
|
{"getcwd", mac_getcwd},
|
||||||
{"listdir", mac_listdir, 0},
|
{"listdir", mac_listdir, 0},
|
||||||
{"lseek", mac_lseek},
|
{"lseek", mac_lseek},
|
||||||
{"mkdir", mac_mkdir},
|
{"mkdir", mac_mkdir, 1},
|
||||||
{"open", mac_open},
|
{"open", mac_open},
|
||||||
{"read", mac_read},
|
{"read", mac_read},
|
||||||
{"rename", mac_rename},
|
{"rename", mac_rename},
|
||||||
|
|
@ -553,6 +564,7 @@ static struct methodlist mac_methods[] = {
|
||||||
{"stat", mac_stat},
|
{"stat", mac_stat},
|
||||||
{"xstat", mac_xstat},
|
{"xstat", mac_xstat},
|
||||||
{"sync", mac_sync},
|
{"sync", mac_sync},
|
||||||
|
{"remove", mac_unlink},
|
||||||
{"unlink", mac_unlink},
|
{"unlink", mac_unlink},
|
||||||
{"write", mac_write},
|
{"write", mac_write},
|
||||||
#ifdef MALLOC_DEBUG
|
#ifdef MALLOC_DEBUG
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue