From: [EMAIL PROTECTED] Operating system: Linux 2.4.17, Debian unstable PHP version: 4.1.0 PHP Bug Type: POSIX related Bug description: The POSIX access(2) function is not available
Seeing as is_readable, is_writeable and is_executable all work out the file permissions masks themselves, it might be nice to have access to the posix function access(2) so that file permissions in situations where mask comparision is not sufficient (e.g. when using POSIX ACL's on the filesystem, such as is available with SGI's XFS on Linux and Irix). It should simply be a matter of (in ext/posix/posix.c #include <unistd.h> .... PHP_FE(posix_access, NULL) .... /* {{{ proto bool posix_access(string filename, int mode) check user's permissions for a file */ PHP_FUNCTION(posix_access) { char *filename = NULL; int argc = ZEND_NUM_ARGS(); int mode = 0; if (zend_parse_parameters(argc TSRMLS_CC, "s|l", &filename, &mode) == FAILURE) return; if (access(filename, mode) != 0) { php_error(E_WARNING,"posix_access: error checking access for %s: %s", filename, strerror(errno)); } else { return 0; } } As far as I can see, access() has always been a POSIX function. -- Edit bug report at: http://bugs.php.net/?id=14924&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]