KSP-KOS/KOS — pull request #469 by Dunbaratu (2015-01-01 03:33:30+00:00)
Title: fixed #458 - you can now "tail -f" on LOG output.

As long as the log file is on the Archive and is therefore
a real file and not just a string in memory, the LOG command
will now append lines of text to the end of the file without
erasing and re-writing the whole file on each line like it used
to.

This means the unix (or gitbash) "tail -f" command now works
properly on log files and can see them being appended to as they
are being written.

I thought this would be simple but it was a bit slower to solve
than I expected because apparently Microsoft's mentality is
to presume that the *default* behavior every programmer would
naturally want is to have the most crippling file access rules
possible. It threw exceptions if I tried to write to a file that
is currently being tail'ed.

I eventually found the right flags to force C#'s File.Open()
to behave more reasonably (allowing multiple processes to have
the file open so one can read what the other is writing) and
got it working now. It wasn't that hard once I knew that was
the problem. It just took a while to notice that's what was
wrong because the idea that never mentioning file acess rules causes
exclusivity was utterly alien. So alien it never even occurred
to me to check for that as a potential cause.