1
0
mirror of https://github.com/php/php-src.git synced 2026-03-31 20:53:00 +02:00

- Add php_u_stat()

This commit is contained in:
Marcus Boerger
2007-01-16 22:10:25 +00:00
parent 1c60406349
commit 207dd9cefd
2 changed files with 17 additions and 0 deletions

View File

@@ -752,6 +752,22 @@ PHP_FUNCTION(clearstatcache)
#define IS_ABLE_CHECK(__t) ((__t) == FS_IS_R || (__t) == FS_IS_W || (__t) == FS_IS_X)
#define IS_ACCESS_CHECK(__t) (IS_ABLE_CHECK(type) || (__t) == FS_EXISTS)
PHPAPI void php_u_stat(zend_uchar filename_type, const zstr filename, php_stat_len filename_length, int type, php_stream_context *context, zval *return_value TSRMLS_DC) /* {{{ */
{
char *fn;
if (filename_type == IS_STRING) {
php_stat(filename.s, filename_length, type, return_value TSRMLS_CC);
} else {
if (FAILURE == php_stream_path_encode(NULL, &fn, &filename_length, filename.u, filename_length, REPORT_ERRORS, context)) {
RETURN_FALSE;
}
php_stat(filename.s, filename_length, type, return_value TSRMLS_CC);
efree(fn);
}
}
/* }}} */
/* {{{ php_stat
*/
PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value TSRMLS_DC)

View File

@@ -88,6 +88,7 @@ typedef int php_stat_len;
#endif
PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value TSRMLS_DC);
PHPAPI void php_u_stat(zend_uchar filename_type, const zstr filename, php_stat_len filename_length, int type, php_stream_context *context, zval *return_value TSRMLS_DC);
/* Switches for various filestat functions: */
#define FS_PERMS 0