mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
- MFB: add php_mkdir_ex
This commit is contained in:
parent
18d36265fd
commit
d7772d5203
2 changed files with 10 additions and 4 deletions
|
@ -1408,7 +1408,7 @@ PHPAPI PHP_FUNCTION(fseek)
|
||||||
/* {{{ proto int mkdir(char *dir int mode)
|
/* {{{ proto int mkdir(char *dir int mode)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC)
|
PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -1420,12 +1420,17 @@ PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = VCWD_MKDIR(dir, (mode_t)mode)) < 0) {
|
if ((ret = VCWD_MKDIR(dir, (mode_t)mode)) < 0 && (options & REPORT_ERRORS) == 1) {
|
||||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC)
|
||||||
|
{
|
||||||
|
return php_mkdir_ex(dir, mode, REPORT_ERRORS TSRMLS_CC);
|
||||||
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* {{{ proto bool mkdir(string pathname [, int mode [, bool recursive [, resource context]]])
|
/* {{{ proto bool mkdir(string pathname [, int mode [, bool recursive [, resource context]]])
|
||||||
|
|
|
@ -72,6 +72,7 @@ PHP_MINIT_FUNCTION(user_streams);
|
||||||
PHPAPI int php_le_stream_context(void);
|
PHPAPI int php_le_stream_context(void);
|
||||||
PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC);
|
PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC);
|
||||||
PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC);
|
PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC);
|
||||||
|
PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC);
|
||||||
PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC);
|
PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC);
|
||||||
|
|
||||||
#define META_DEF_BUFSIZE 8192
|
#define META_DEF_BUFSIZE 8192
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue