sas Thu Oct 3 21:04:01 2002 EDT Modified files: /TSRM tsrm_virtual_cwd.c tsrm_virtual_cwd.h Log: Add VCWD_ACCESS Index: TSRM/tsrm_virtual_cwd.c diff -u TSRM/tsrm_virtual_cwd.c:1.30 TSRM/tsrm_virtual_cwd.c:1.31 --- TSRM/tsrm_virtual_cwd.c:1.30 Wed May 29 04:41:21 2002 +++ TSRM/tsrm_virtual_cwd.c Thu Oct 3 21:04:00 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tsrm_virtual_cwd.c,v 1.30 2002/05/29 08:41:21 rvenkat Exp $ */ +/* $Id: tsrm_virtual_cwd.c,v 1.31 2002/10/04 01:04:00 sas Exp $ */ #include <sys/types.h> #include <sys/stat.h> @@ -539,6 +539,24 @@ CWD_STATE_FREE(&new_state); return f; } + +#if !defined(TSRM_WIN32) +CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) +{ + cwd_state new_state; + int ret; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + virtual_file_ex(&new_state, pathname, NULL); + + ret = access(new_state.cwd, mode); + + CWD_STATE_FREE(&new_state); + + return ret; +} +#endif + #if HAVE_UTIME CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) Index: TSRM/tsrm_virtual_cwd.h diff -u TSRM/tsrm_virtual_cwd.h:1.19 TSRM/tsrm_virtual_cwd.h:1.20 --- TSRM/tsrm_virtual_cwd.h:1.19 Wed May 29 04:41:21 2002 +++ TSRM/tsrm_virtual_cwd.h Thu Oct 3 21:04:00 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tsrm_virtual_cwd.h,v 1.19 2002/05/29 08:41:21 rvenkat Exp $ */ +/* $Id: tsrm_virtual_cwd.h,v 1.20 2002/10/04 01:04:00 sas Exp $ */ #ifndef VIRTUAL_CWD_H #define VIRTUAL_CWD_H @@ -146,6 +146,11 @@ CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC); CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC); CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC); + +#if !defined(TSRM_WIN32) +CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC); +#endif + #if HAVE_UTIME CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC); #endif @@ -195,6 +200,7 @@ #define VCWD_RMDIR(pathname) virtual_rmdir(pathname TSRMLS_CC) #define VCWD_OPENDIR(pathname) virtual_opendir(pathname TSRMLS_CC) #define VCWD_POPEN(command, type) virtual_popen(command, type TSRMLS_CC) +#define VCWD_ACCESS(pathname, mode) virtual_access(pathname, mode TSRMLS_CC) #if HAVE_UTIME #define VCWD_UTIME(path, time) virtual_utime(path, time TSRMLS_CC) #endif @@ -221,6 +227,7 @@ #define VCWD_RMDIR(pathname) rmdir(pathname) #define VCWD_OPENDIR(pathname) opendir(pathname) #define VCWD_POPEN(command, type) popen(command, type) +#define VCWD_ACCESS(pathname, mode) access(pathname, mode) #if !defined(TSRM_WIN32) && !defined(NETWARE) #define VCWD_REALPATH(path, real_path) realpath(path, real_path)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php