RE: [PHP] RE: Can you make a file empty?
| From: | Tim Ward | Date: | Thu, 22 Feb 2001 11:14:37 +0000 |
| Subject: | RE: [PHP] RE: Can you make a file empty? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-41141@lists.php.net to get a copy of this message | ||
the manual implies that you don't need to write anything to the file to
clear what's in it already, is this not the case?
Tim Ward
Senior Systems Engineer
Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html
> -----Original Message-----
> From: PHPBeginner.com [mailto:php-general@phpbeginner.com]
> Sent: 22 February 2001 11:15
> To: Tim Ward; jan@grafstrom.net; php-general@lists.php.net
> Subject: RE: [PHP] RE: Can you make a file empty?
>
>
> yeah, you can just fputs() an empty string in it and close the file.
> In this way you'll empty it all.
>
>
> Sincerely,
>
> Maxim Maletsky
> Founder, Chief Developer
>
> PHPBeginner.com (Where PHP Begins)
> maxim@phpbeginner.com
> www.phpbeginner.com
>
>
>
>
> -----Original Message-----
> From: Tim Ward [mailto:tim.ward@stivesdirect.com]
> Sent: Wednesday, February 21, 2001 8:30 PM
> To: 'jan@grafstrom.net'; php-general@lists.php.net
> Subject: [PHP] RE: Can you make a file empty?
>
>
> does this not already do it? according the manual "w" as the second
> parameters will "place the file pointer at the beginning of
> the file and
> truncate the file to zero length".
>
> Tim Ward
> Senior Systems Engineer
>
> Please refer to the following disclaimer in respect of this message:
> http://www.stivesdirect.com/e-mail-disclaimer.html
>
>
> > -----Original Message-----
> > From: Jan Grafström [mailto:jan@lillemanshus.com]
> > Sent: 20 February 2001 18:47
> > To: php-general@lists.php.net
> > Subject: Can you make a file empty?
> >
> >
> > Hi!
> > I am trying to delete all text in a file.
> > $yourfile = "file.txt";
> > $fp = fopen($yourfile,w)
> > "is there any good code to put in here?"
> > fclose($fp);
> >
> > Thanks for any help.
> >
> > Regards
> >
> > Jan
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
>