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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -