logoalt Hacker News

qbanetoday at 12:48 AM1 replyview on HN

It's C library taking care of the "b" part for you according to the article.


Replies

waherntoday at 1:01 AM

It's the other way around. It's the C runtime that treats text ("t") mode differently, because the C standard specifies \n as a line delimiter but the Windows convention is \r\n. In text mode C stdio translates between \n and \r\n. In binary mode it does no translation.