I have this code to write information to my file:
[php]if ($newmessage ne ‘’)
{
print NEW $newmessage;
print $newmessage;
if ($chatLogging) {
my $now_string = gmtime;
if (open(CHATLOG, “>>$chatpath/$logFileName”)) {
print CHATLOG $nowtimestring .’ ’ . ‘’ . $formdata{‘cname’} . ‘:’ . ‘’ .$ColoredMessage . ‘
’ ."\n";
close(CHATLOG);
}
[/php]
This code writes allways new line so eventually some day I have huge file.
What should I do to empty file before writing so that there is always only one line in the file???
Kari
