bool is_readable ( string filename [, bool use_include_path] )

we can always dream ..
so far the answer has been that this parameter should never have been added to fopen(), and that file_exists(), is_readable and friends should never get this feature. IIRC the reason was that they should not be reading the include path, however even proposing to be atleast able to pass in an order list of search pathes has been shot down. nevermind the common use case for such a feature.

How about something which will save having to resolve that path twice?

$realpath = stream_resolve_include_path($relativepath);

if ($realpath && is_readable($realpath)) {
  $fp = fopen($realpath, 'rb', false);
} else {
  /* File isn't readable */
}

The code for doing this is all in there, it'd just need some quick exposing to userspace...

-Sara

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to