RE: [PHP] RE: Can you make a file empty?

From: Date: Thu, 22 Feb 2001 11:20:33 +0000
Subject: RE: [PHP] RE: Can you make a file empty?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-41142@lists.php.net to get a copy of this message
Year.. probably it is .... I've never tried ... In this cases If I need it empty I just remove it, and when I write in if it doesn't exists then new file is being generating ... It feels easier to me ... -----Original Message----- From: Tim Ward [mailto:tim.ward@stivesdirect.com] Sent: Thursday, February 22, 2001 8:15 PM To: 'PHPBeginner.com'; Tim Ward; jan@grafstrom.net; php-general@lists.php.net Subject: RE: [PHP] RE: Can you make a file empty? 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 > >

« previous php.general (#41142) next »