Re: how to read a file into a GString



bleah.  i was hoping for a more general function.  something along the
line of fgets.

unfortunately, reading the entire file at once would make my code bigger
and uglier, rather than smaller and cleaner.

since i'm reading /usr/share/dict/words, it would also be a PITA for the
user.  many small accesses would, in the long run, be more expensive to
do, but **much** less expensive to the user's patience.

pete


begin Havoc Pennington <hp redhat com> 
> 
> Peter Jay Salzman <p dirac org> writes: 
> > 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?
> 
> Look at the source to g_file_get_contents() in GLib 1.3.12
> 
> Havoc

-- 
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]