Hi, the easiest way is to open the file in a write only mode. $fp=fopen("/var/mail/myaccount","w"); $fclose($fp);
Here's an excerpt from http://www.php.net/manual/en/function.fopen.php 'w' - Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. Hope this helps Dobromir Velev Web Developer http://www.websitepulse.com/ -----Original Message----- From: DigitalKoala <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Tuesday, December 11, 2001 19:09 Subject: [PHP-DB] delete file contents (sorry if i posted this twice, problem with signing up) >Hi Everyone, > >I'm running a script that automatically reads lines from >/var/mail/myaccount, parses the lines then insert specific items into a >database.... this is in a loop > >What i want to do is then delete the contents of the file, but not the file >itself...can you tell me the best way to do this? > >many thanks >anna > > > > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]