|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-07 17:09 UTC] magnus@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 07:00:01 2025 UTC |
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.