[Vala] GZFileStream question



Hi,

I'm having trouble reading a gzipped file in vala using the short example below.

It works if I edit the c file so that gzread and gzclose take fid rather than &fid as their first argument.

Is this a problem with the binding or am I doing something wrong?

Thanks,

Kerby



using ZLib;
using GLib;

public class test_libz {

    static int main (string[] args) {

         var fid = ZLib.GZFileStream.open("test.gz", "rb");

         string s = string.nfill(11, '*');
         fid.read(s, 10);
         stdout.printf("%s\n", s);
         fid.close();
    }
}


--- snipppet from c file:

        gzFile fid;
        char* s;
        gint f;
        fid = gzopen ("test.gz", "rb");
        s = g_strnfill (11, '*');
        f = gzread (&fid, s, 10); /* change &fid to fid */
        fprintf (stdout, "%s\n", s);
        gzclose (&fid); /* change &fid to fid */




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