Re: is_executable() ???

From: Date: Mon, 07 Jan 2008 23:27:49 +0000
Subject: Re: is_executable() ???
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-266858@lists.php.net to get a copy of this message
Al wrote:
clearstatcache(); if(is_executable(PATH_TO_SOURCE_DIR . $filename) { code } Always returns true for: foo.jpg foo.php foo.sh And even if I feed it a non existing file.
Really? <?php $file = 'blah.de.blah'; echo 'file exists: ' . is_file($file) . "\n"; echo 'is exec: ' . is_executable($file) . "\n"; ?> file exists: is exec: Check the permissions on those files through ftp or ssh. Are they 755 or are they 644 ? If they are 755 (or 775 or 777) then they are actually executable files. Whether you get a valid result from that or not is entirely separate but in *nix you could make a .txt file executable and it won't care. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#266858) next »