[Phpwm] unlinking files

Rob Allen rob at akrabat.com
Fri Sep 29 11:32:04 BST 2006


Phil Beynon wrote:

> 
> if(file_exists("./75px/" . $thumb_name) AND !is_dir("./75px/" .
> $thumb_name)){unlink("./75px/" . $thumb_name);}
> 
> now it says if the files exists and its not just a directory path without a
> file name then delete it
> 
> Note the inversion on is_dir()
> 
> It didnt actually manage to delete the directory, but it came up with the
> sort of error message that has users disturbing techies! :-)
> 
*grin*


I've just checked our library code and we do:

if (is_file($form_field_file) && !is_dir($form_field_file))
{
    // do stuff
}


I wonder what the difference between file_exists() and is_file()
actually is?!

Regards,

Rob...




More information about the Phpwm mailing list