why do you need that for tail-f? just write the partial line to the terminal and then continue with the rest. the actual probelm is that getsdoes not tell you if the line was partial and it removes the linebreak, so instead using a method to read the stream that doesn't remove linebreaks should work...
greetings, martin.