Reply to Re: to control if unlink worked good

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация