how to read a file into a GString



currently, i need to do something like:

   gchar string[INPUT_SZ];
   if ((fp = fopen(ctl.dictionary->str, "r")) == NULL)
	      die(1, "fopen error in FindAlphaParse");

   while (fgets(string, INPUT_SZ - 1, fp) != NULL) {
   	/* code */
   }

the code would be much nicer if i could read the file data directly
into a GString rather than into a gchar and convert the gchar to a
GString.

is there a way to read a file directly into a GString?

pete

-- 
PGP Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D
PGP Public Key:  finger p dirac org



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]