Ceki Gülcü wrote:
>
> For the FileAppender case, file file.length == 0 check works for the header.
>However, for a file opened twice, you will still get two tails in the file, one in
>the middle from the first open and one at the end from the second open. Do you see
>what I mean?
>
Yes! I didn't even think about that when I was working on it.
> One solution is to add structure to the headers and footers. For example by adding a
>special separator, look for the separator and remove the tail.
>
Like Netscape uses the "--" to seperate the message from the signature!
Will the "--" work? It's nonintrusive and if it's matched on a line by
itself ("^--$" in regexp terms) I don't think we will run into the
problem of it possibly being a log entry.
Hmmm... I may have just had an e.piphany (that's e <dot> piphany)...
What if we put that after the header also. When the file is opened the
FileAppender looks in the file two occurances of "^--$". The first
trails the header, so it removes the header. The second one preceeds the
footer, so it removes the footer.
What if there's only one? I guess that depends on if there is text
preceding or trailing it. It would act accordingly in either case.
To much time? File opening is a little intensive anyway. I don't think
it would add a considerable amount of overhead. Do you?
Does this make sense? Comments?
/mike
--
******************************************
Mike Dougherty -- Java Software Engineer
******************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]