that will work too... but you wont get a response back if the unlink fails
(other thn a nasty php error). you will with charles method.

plus sometimes things that arent a file will pass true on the file_exists()
function.
i mean you can do all the checks like
if (file_exists($dest_file) && is_file($dest_file) && etc etc etc) {
    unlink($dest_file)
}

-- or -- do charles method and be sure if you want to delete it is gets
deleted.

if (unlink($dest_file)) {
    // Actions when deleted
}else {
    // Actions if file does not exist, or fails, or is errored, or etc etc
etc......
}


Joel Colombo



"Philip J. Newman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> how about just
>
>        if (file_exists($dest_file)) {
>            unlink ($dest_file);
>
>          }
>
> ----- Original Message -----
> From: "Charles Kline" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, March 17, 2003 6:04 PM
> Subject: Re: [PHP] File System
>
>
> > $result = unlink("file.txt") or die("Operation failed!');
> >
> > On Monday, March 17, 2003, at 12:58 AM, Philip J. Newman wrote:
> >
> > > How do i delete a file  ... ?
> > >
> > > kill?? dele *srugs*
> > >
> > > ------
> > > Philip J. Newman.
> > > Head Developer
> > > [EMAIL PROTECTED]
> > >
> > > +64 (9) 576 9491
> > > +64 021-048-3999
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to