From: Nick C. <ni...@cl...> - 2002-04-06 22:27:10
|
On Fri, Apr 05, 2002 at 10:38:14PM +0100, Nick Cleaton wrote: > > Now it nearly passes its first test, but not quite. > The guestlog isn't valid XHTML because the entries are > appended after the </html>, so we'll need to do the whole > tmp-file-and-rename-into-place for that as well as the > guestbook :( > The way I see it, we have 3 options: Rewrite the whole log file each time. Inefficient for a large log file, but the cost of rewriting the guestbook should dominate unless the guestbook gets cleaned out more frequently than the log file. At each write, truncate the "</body>\n</html>\n" off the end of the log file, write the new entry, then put the footer back. Just append as we do now, but make it OK by distributing a guestlog.txt file rather than a guestlog.html file. Thoughts ? -- Nick |