Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25998 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47835 invoked by uid 1010); 9 Oct 2006 03:56:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 47820 invoked from network); 9 Oct 2006 03:56:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2006 03:56:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=ralph@smashlabs.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ralph@smashlabs.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain smashlabs.com from 69.2.42.244 cause and error) X-PHP-List-Original-Sender: ralph@smashlabs.com X-Host-Fingerprint: 69.2.42.244 unknown Linux 2.4/2.6 Received: from [69.2.42.244] ([69.2.42.244:49022] helo=users.smashlabs.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A2/99-05675-B58C9254 for ; Sun, 08 Oct 2006 23:56:12 -0400 Received: (qmail 31791 invoked from network); 8 Oct 2006 22:56:02 -0500 Received: from unknown (HELO ?10.20.0.133?) (ralph@smashlabs.com@66.69.233.10) by 244.42.ntg.com with AES256-SHA encrypted SMTP; 8 Oct 2006 22:56:02 -0500 Message-ID: <4529C852.30206@smashlabs.com> Date: Sun, 08 Oct 2006 22:56:02 -0500 User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: Sara Golemon CC: Lukas Kahwe Smith , internals References: <4526D167.1080309@smashlabs.com> <45274D24.7040206@php.net> <45293676.1060902@php.net> In-Reply-To: <45293676.1060902@php.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: is_readable and include path From: ralph@smashlabs.com (Ralph Schindler) Sara Golemon wrote: >>> bool is_readable ( string filename [, bool use_include_path] ) >> >> we can always dream .. I prefer the word "mature" instead of dream ;) >> > 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 that is an interesting suggestion,.. in researching other options, how about this: string realpath ( string path [, bool use_include_path]) This makes more sense to me, plus it can be done once and wont have to worry about including this in the family of file functions. This seems like a logical place to resolve paths., including file that reside in the relative include-path. Think this can fly? -ralph