// example: $stream = fopen( FILE , 'rb') or die('???'); $md = stream_get_meta_data($stream); echo $md['wrapper_type'];
flock($stream);
if it prints plainfile, then the php flock () function call is handled by php_stdiop_set_option (...), which calls flock (). Depending on whether PHP is compiled with HAVE_FLOCK or not, this may be a
flock () system call or a function defined in flock_compat.c that uses
fcntl () . On my system, gentoo PHP was compiled with HAVE_FLOCK.
main / streams / plain_wrapper.c @static int php_stdiop_set_option (...):
case PHP_STREAM_OPTION_LOCKING:
if (fd == -1) {
return -1;
}
if ((zend_uintptr_t) ptrparam == PHP_STREAM_LOCK_SUPPORTED) {
return 0;
}
if (! flock (fd, value)) {
data-> lock_flag = value;
return 0;
} else {
return -1;
}
break;
VolkerK Jun 16 '09 at 14:49 2009-06-16 14:49
source share