g_io_channel_write_chars() bug?



    Hello all.
I found that g_io_channel_write_chars() writes to a file
at most 2046 bytes. I think it's a bug, as I didn't find
anything about this in the docs.
I would like to know if this is filesystem-dependent,
or kernel-dependent.
I'm using a RedHat 8.0 download version, gtk+-2.0.
Some code to illustrate this:
-------
#include <gtk/gtk.h>
GIOChannel *file;
GIOStatus b;
GError *error;
gsize a, bytes_written;
GString *p;

int main(int argc, char *argv[])
{
        gtk_init(&argc, &argv);
        file=g_io_channel_new_file("z.txt", "w", &error);
        b=g_io_channel_write_chars(file, "hello!\n", -1, NULL, &error);
        p=g_string_new("");
        a=0;
        while(a<=3042)       /* some "big" number */
        {
                g_print("string legth:%d\n", a);
                b=g_io_channel_write_chars(file, p->str, -1, &bytes_written, &error);
                /* tests for errors */
                if(b!=G_IO_STATUS_NORMAL) g_print("io status not normal: %d\n", b);
                if(error) g_print("ERROR:%d :%s \n", error->code, error->message);
                g_print("bytes written:%d\n", bytes_written);
                b=g_io_channel_write_unichar(file, '\n', &error);
                p=g_string_append_unichar(p, 'a');
                a++;
        };
        b=g_io_channel_shutdown(file, TRUE, &error);
        return(0);
}
--------
I have dialup internet access, so my answers will probably
be delayed.







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