Added amx_mkdir for twistedeuphoria

This commit is contained in:
David Anderson 2005-01-30 05:32:10 +00:00
parent cc462c9ccb
commit a189c0bda7
2 changed files with 17 additions and 1 deletions

View File

@ -2771,6 +2771,18 @@ static cell AMX_NATIVE_CALL lang_phrase(AMX *amx, cell *params)
return 1;
}
static cell AMX_NATIVE_CALL amx_mkdir(AMX *amx, cell *params)
{
int len = 0;
char *path = get_amxstring(amx, params[1], 0, len);
#ifdef __linux__
return mkdir(path, 0700);
#else
return mkdir(path);
#endif
}
AMX_NATIVE_INFO amxmod_Natives[] = {
{ "client_cmd", client_cmd },
{ "client_print", client_print },
@ -2934,5 +2946,6 @@ AMX_NATIVE_INFO amxmod_Natives[] = {
{ "md5_file", amx_md5_file },
{ "plugin_flags", plugin_flags},
{ "lang_phrase", lang_phrase},
{ "mkdir", amx_mkdir},
{ NULL, NULL }
};

View File

@ -677,4 +677,7 @@ forward plugin_modules();
native require_module(const module[]);
native is_amd64_server();
native is_amd64_server();
/* Returns 0 on success, like the POSIX specification */
native mkdir(const dirname[]);