[haiku-development] Re: Help reading text file.

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 03 Aug 2008 14:15:14 +0200 CEST

Andreas Färber <andreas.faerber@xxxxxx> wrote:
> > I'm trying to read one line at a time from a joystick description
> > text
> > file (/boot/home/config/settings/joysticks).
> >
> > I have some code that nearly works but not close enough as it
> > contains
> > text that are not shown as text but square.
> Maybe your square is \r? I'd assume Haiku to have \r\n newlines, and
> I
> don't see a check for stripping \r.

Haiku definitely only has '\n' as newlines. Of course, the text files
might have been edited on Windows, and be garbled that way.
But for the original question, there is nothing wrong in using the
POSIX stdio functions to read text files in Haiku either. It's just
more convenient, as we don't have any line reader functions/classes yet
:-)

Bye,
   Axel.


Other related posts: