Re: File System
| From: | Joel Colombo | Date: | Mon, 17 Mar 2003 08:41:23 +0000 |
| Subject: | Re: File System | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139917@lists.php.net to get a copy of this message | ||
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" <newmanpj@philipnz.com> wrote in message
news:009d01c2ec4b$9af51310$0401a8c0@philip...
> how about just
>
> if (file_exists($dest_file)) {
> unlink ($dest_file);
>
> }
>
> ----- Original Message -----
> From: "Charles Kline" <ckline@rightcode.net>
> To: <php-general@lists.php.net>
> 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
> > > info@philipnz.com
> > >
> > > +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
> >
>