4 ms·
I've seen RS and LF used together to delineate records in log files. It's useful when there's a chance of power loss or program crash during logging and it's i
by jlokier 5y ago
I've seen RS and LF used together to delineate records in log files.
It's useful when there's a chance of power loss or program crash during logging and it's important to recover all the written records.
With conventional logging that terminates each line with LF, if the write is interrupted, after the program restarts the next logged line is merged with the previous part-line. The result is the first line of each log file after each restart is junk and fails to match whatever patterns are scanned for later.
When each line begins with RS and ends with LF, lines that are written whole are always found later.