Re: deleting file contents
| From: | Mike Eheler | Date: | Tue, 11 Dec 2001 18:50:55 +0000 |
| Subject: | Re: deleting file contents | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-77327@lists.php.net to get a copy of this message | ||
$fp = fopen('/var/mail/myaccount','w');
fwrite($fp,'');
fclose($fp);
that could work. I was going to suggest doing:
unlink('/var/mail/myaccount');
touch('/var/mail/myaccount');
But I assume that since you're against deleting it, then there must be some sort of permissions in place that you don't want changed.
Mike
--
"Sex is like air. It's not important unless you're not getting any."
-- Unknown
Digitalkoala wrote:
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