views:

72

answers:

1

I have a line-oriented text file (Unicode) that was created using CreateFile() and WriteFile().

Reading that file as a binary stream using ReadFile() is straightforward, but extra low-level processing is needed to break it into lines.

Is there a Win32 function that does this for me?

Again, please note that it's in 'C' (not C++) and I don't want to use POSIX/ANSI C functions such as readline().

If the answer to the aforementioned question is negative, what would be the "shortest code" to accomplish reading a line-oriented text file, using native Win32 C functions only? e.g. using ReadFile(), StrChr(), etc.

Thanks.

+1  A: 

AFAIK there is no win32 function for reading file line by line.

Vadim Shender
This is indeed what I have observed so far from examining:http://msdn.microsoft.com/en-us/library/aa364232%28VS.85%29.aspxBut I may be missing something.
Android Eve
The following great article shows unequivocally that there is no gets() equivalent in Win32:http://www.apitalk.com/windows-Programming/Why-Unicode-Is-Important-Before-You-Start-To-Program.htmlSo the next step for me is to create my own function to mimic that, using ReadFile() and StrChr().
Android Eve