in reply to Read a line up to a maximum length

Is there any particular reason you didn't use read, sysread or any of the other suggestions posted in that thread? You didn't exactly participate in the discussion, or say why those solutions don't work for you.

C.