Is there a way to detect or change the EOL format from windows to linux in C++? -
my application cannot read windows format eol files, there's way can detect format of files? or change eol linux format? able display error message if format not linux. know windows format eol crlf , linux lf.
just:
- open file in binary mode
- find first '\n' byte
- check if byte before found 1 equals '\r'
if ask if there such functionality in standard library, answer - there isn't.
Comments
Post a Comment