Re: using include_path with file_exists()

From: Date: Tue, 20 Feb 2001 16:33:48 +0000
Subject: Re: using include_path with file_exists()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-40750@lists.php.net to get a copy of this message
Hi Ben, I thought maybe there was something like HTTP_SERVER_VARS["INCLUDE_PATH"], but apparently not. Could you just define your own $GLOBALS["my_include_path"] = and use that with file_exists()?? Mike D. Ben Peter wrote: > > Hi all, > > is there a decent way to check whether a file is available on the > include_path? The only soultion I have found is > > if ( ( $fd = fopen( 'my_file', 'r', 1 ) ) ) { > fclose( $fd ); > /* ok, file is there */ > } > > That one's not really nice, at it opens the file for reading. > > It would be best to have the include_path switch for file_exists, just > as it works with fopen. > > Can someone better my workaround above? > > Cheers, > Ben >

« previous php.general (#40750) next »