Re: Wrapped DataInputStream API?



Hi Jonathan,

Thanks, this was already quite useful, I think I just drop the whole
Gio-thing and use GLib instead.

On Wed, 24 Nov 2010 22:44:30 +0100
Jonatan Liljedahl <lijon kymatica com> wrote:

> This works in seed:
> 
> GLib=imports.gi.GLib;
> GLib.file_get_contents("COPYING",x={});
> lines = x.contents.split("\n");

Your code works in Seed just fine, but interestingly, it fails so in
Gjs, because "Error: Failed to convert UTF-8 string to JS string:
Invalid byte sequence in conversion input"

And I think I prefer to read the file linewise, not to use too much
memory if not neccessary. But I saw something about GLib FileStreams,
so that might work just fine :)

regards,
Marek


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