Re: libseed-list trying to read a gio stream



There are numerous examples in the seed-examples git repo that do the following:

file = Gio.file_new_for_path(filename);
content = file.read().get_contents();

I think get_contents() is a seed extension, but I don't remember. There's also Gio.simple_read (another seed extension):

http://git.gnome.org/cgit/seed/tree/extensions/Gio.js

Also, out arguments work like so:

http://git.gnome.org/cgit/seed/tree/tests/javascript/out-test.js

(there's a lot of good stuff/demonstrations of stuff that hasn't been documented yet in the tests tree)

On Nov 24, 2009, at 22:37, Jonatan Liljedahl wrote:

> Here I come with more problems... Sorry. :)
> 
> I'm trying to read a file with Gio:
> 
> > gio = imports.gi.Gio
> [object Object]
> 
> > f = gio.file_new_for_path("helloworld.js")
> [object GLocalFile]
> > x = f.read()
> [object GLocalFileInputStream]
> > x.read()
> 
> (seed:2637): GLib-GIO-CRITICAL **: g_input_stream_read: assertion `buffer != NULL' failed
> 0
> > buf = {}
> [object Object]
> > x.read(buf)
> 
> (seed:2637): GLib-GIO-CRITICAL **: g_input_stream_read: assertion `buffer != NULL' failed
> 0
> > buf = []
> 
> > x.read(buf)
> 
> (seed:2637): GLib-GIO-CRITICAL **: g_input_stream_read: assertion `buffer != NULL' failed
> 0
> >
> 
> How does functions that take an output parameter map to javascript in seed? I thought they would return the output, or an object with a property for each output if there are several?
> 
> /Jonatan
> _______________________________________________
> libseed-list mailing list
> libseed-list gnome org
> http://mail.gnome.org/mailman/listinfo/libseed-list



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