Quote:
Originally posted by FuqALot
Yo,
$file = "x.txt";
open(logfile,"+<".$file);
flock logfile, 2;
@logdata = <logfile>;
seek logfile, 0, 0;
print logfile $newline."\n";
print logfile @logdata;
truncate logfile, (tell logfile);
close(logfile);
is the way. Where $newline is the entry, and $file the logfile.
|
open(LOG,"+<".$log);
flock LOG, 2;
@logdata = <log>;
seek LOG, 0, 0;
print LOG '<TR><TD>';
print LOG @group[1];
print LOG '</TD>';
print LOG '<TD><A HREF=';
print LOG @url[1];
print LOG '>';
print LOG @description[1];
print LOG '</A></TD></TR>';
print LOG "\n";
print LOG @logdata;
truncate LOG, (tell logfile);
close(LOG);
This worked like a charm, I liked the reverse open idea just couldnt get it to work.
Thanks everyone
