pajoye Fri Jan 13 04:10:32 2006 UTC
Modified files:
/php-src/ext/standard file.c file.h
Log:
- MFB: add php_mkdir_ex
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/file.c?r1=1.414&r2=1.415&diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.414 php-src/ext/standard/file.c:1.415
--- php-src/ext/standard/file.c:1.414 Sun Jan 1 13:09:55 2006
+++ php-src/ext/standard/file.c Fri Jan 13 04:10:32 2006
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.414 2006/01/01 13:09:55 sniper Exp $ */
+/* $Id: file.c,v 1.415 2006/01/13 04:10:32 pajoye Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -1408,10 +1408,10 @@
/* {{{ 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;
-
+
if (PG(safe_mode) && (!php_checkuid(dir, NULL,
CHECKUID_CHECK_FILE_AND_DIR))) {
return -1;
}
@@ -1420,11 +1420,16 @@
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));
}
- return ret;
+ return ret;
+}
+
+PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC)
+{
+ return php_mkdir_ex(dir, mode, REPORT_ERRORS TSRMLS_CC);
}
/* }}} */
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/file.h?r1=1.96&r2=1.97&diff_format=u
Index: php-src/ext/standard/file.h
diff -u php-src/ext/standard/file.h:1.96 php-src/ext/standard/file.h:1.97
--- php-src/ext/standard/file.h:1.96 Sun Jan 1 13:09:55 2006
+++ php-src/ext/standard/file.h Fri Jan 13 04:10:32 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.h,v 1.96 2006/01/01 13:09:55 sniper Exp $ */
+/* $Id: file.h,v 1.97 2006/01/13 04:10:32 pajoye Exp $ */
/* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */
@@ -72,6 +72,7 @@
PHPAPI int php_le_stream_context(void);
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_mkdir_ex(char *dir, long mode, int options TSRMLS_DC);
PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC);
#define META_DEF_BUFSIZE 8192
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php