Posted by Rik on 03/02/07 11:25
On Fri, 02 Mar 2007 11:46:13 +0100, den <spamnot@not.not> wrote:
> if ( file_exists($file) )
> {
> unlink($file);
> }
>
> for to control if the deleted is executed correctly is
> obligatory write this:
>
> if ( file_exists($file) )
> {
> unlink($file);
> if ( file_exists($file) ) { alert of file not deleted}
>
>
> }
>
> or there is better solution ?
> is also possible intercept the type of error?
ini_set('track_errors',true);
if(file_exists($file)){
if(!unlink($file)) echo 'Could not delete file: '.$php_errormsg;
}
> generally for which reasons does not come executed the elimination?
Normally, if there is a problem, it's with permissions on the file.
--
Rik Wasmus
[Back to original message]
|