#14924 [Asn->Csd]: The POSIX access(2) function is not available
| From: | magnus@php.net | Date: | Fri, 07 Jan 2005 16:09:10 +0000 |
| Subject: | #14924 [Asn->Csd]: The POSIX access(2) function is not available | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-71571@lists.php.net to get a copy of this message | ||
ID: 14924
Updated by: magnus@php.net
Reported By: danpat at au dot adaptiveinterantional dot com
-Status: Assigned
+Status: Closed
Bug Type: Feature/Change Request
Operating System: Linux 2.4.17, Debian unstable
PHP Version: 4.1.0
Assigned To: yohgaki
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Will be in PHP 5.1.
Previous Comments:
------------------------------------------------------------------------
[2002-01-07 22:40:51] danpat at au dot adaptiveinterantional dot com
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 this bug report at http://bugs.php.net/?id=14924&edit=1