Re: how to read a file into a GString
- From: Peter Jay Salzman <p dirac org>
- To: Havoc Pennington <hp redhat com>
- Cc: gtk-list gnome org
- Subject: Re: how to read a file into a GString
- Date: Fri, 28 Dec 2001 10:28:01 -0800
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.
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
PGP Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D
PGP Public Key: finger p dirac org
] [Thread Prev