GLib Bug: IO Channel cannot work with files larger that 2GB

2005-11-30 Thread Chris Morrison
Hi all,

There seems to be a bug with the IO Channel functions in Glib version 2.8.4
for Windows. This bug prevents seeking in files greater than 2GB in size,
i.e. where a 64-bit file pointer would be required.

The following snip of code will work if 'file_channel' refers to a file of
less than 2GB in size, however for a larger file, say 8GB the call to
g_io_channel_seek_position() will fail and gerror will contain
G_IO_CHANNEL_ERROR_INVAL.

GError *gerror = NULL;
gint64 seek_offset = -22;

if (g_io_channel_seek_position(file_channel, seek_offset, G_SEEK_END,
gerror) != G_IO_STATUS_NORMAL)
{
crash_and_burn();
}

Is this a known bug/issue or am I missing something?

Regards,


Chris



smime.p7s
Description: S/MIME cryptographic signature
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


GLib Bug: IO Channel cannot work with files larger that 2GB

2005-11-30 Thread Tor Lillqvist
Chris Morrison writes:
  Is this a known bug/issue or am I missing something?

Yes. Large file support is missing from the Win32 port. Sorry. It
might be possible to do some fixes here and there without needing any
new API or breaking ABI, like using _lseeki64() instead of lseek() in
giowin32.c. (I probably should do that, or can anybody think of any
bad consequences?) 

But there will still be other problems, like that g_stat() uses plain
struct stat and not struct _stati64.

--tml

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list