Closed gpb01 closed 2 years ago
Ok, in your library examples I have seen that you use another method to recognize the EOF (getEOF()) and you use the boolean returned by the method readFileUntil() both to indicate if the terminator has been found or not and for the EOF.
Even if I prefer what I have explained on the previous post, I respect your choice, so ... the issue can be closed.
Guglielmo
Hi thanks for suggestion and sorry for late reply. Yes, your way is simpler but i used this way if the buffer is not large enough and becomes full but the newline char is not reached yet then in that case i can detect and handle it.
Hi, thanks for your answer. Yes, of course, possible with malformed records so ... good idea. :-)
Guglielmo
The method readFileUntil() return "false" for both EOF and the record terminator (terminate character) making it impossible to read record by record a file since, as soon as the terminator of a record (terminate character) is encountered, "false" is returned and it is no longer known whether there are further records or not.
The problem is in this "if":
which I suggest to modify as follows:
to return "false" only in case of EOF.
Guglielmo