GLIB IO Channels problem

Hello guys:
     As I using the GLIB IO Channels, I meet some problem. I wanna use
the IO Channels write  a large memory into the file. Follows is my
code segment...
FILE* mem_dump = fopen("MEM_DUMP.txt","w");
guint bytes = 0 , tmp = 0;
elf_pt = g_malloc0(59397);
GIOChannel* gioc = g_io_channel_unix_new((int)mem_dump);
g_io_channel_write(gioc,elf_pt,59397, &tmp);

when execution, I got the follows message...
(process:12649): GLib-WARNING **: giounix.c:400Error while getting
flags for FD: Bad file descriptor (9)

(process:12649): GLib-WARNING **: Invalid file descriptor.

I have no idea to solve this problem. any good idea????

PS: I'm using the UNIX system.

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