[haiku-development] Re: Teapot diff

 Fredrik Modéen <fredrik@xxxxxxxxx> wrote:

> By the way does BeOS/Haiku API have any way of reading line by line from a
> file? I'm thinking of continue the playlist save/load and settings

The standard way is using fopen/fgets/fclose instead of BFile to do this.
Simple example:


void foo(const char *file)
{
   FILE *f = fopen(file, "r");
   if (!f)
       return;

   char line[4000];
   
  while (fgets(line, sizeof(line), f) != NULL) {
    // note that too long lines will be truncated, but always zero terminated.
  }
  fclose(f);
}



Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT FÜR ALLE NEUEINSTEIGER
Jetzt bei Arcor: günstig und schnell mit DSL - das All-Inclusive-Paket
für clevere Doppel-Sparer, nur  34,95 ?  inkl. DSL- und ISDN-Grundgebühr!
http://www.arcor.de/rd/emf-dsl-2

Other related posts: