Re: g_stat() did not work for large file (>2B) under WIN32



Hi,

On Thu, Jul 30, 2009 at 3:03 AM, Tor Lillqvist<tml iki fi> wrote:
>> I recently found that g_stat() didn't work for large file (>2B) under WIN32.
>
> True, because the struct stat that it uses is the one with a just
> 32-bit st_size. Use gio instead, i.e. get the
> G_FILE_ATTRIBUTE_STANDARD_SIZE. Or call the _stati64() (or
> _wstati64()) function.

Thanks, I will check that.

>
>> I use "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" during compilation
>
> What makes you think these compiler and C library specific macro
> definitions would have any effect on GLib or on the Microsoft C
> library? Those macros affect the Linux C library (glibc) only. They
> should not be used with any other C library (they might after all have
> some entirely unexpected effect on some random C library.) They have
> no standard meaning. Such C library feature selection macros are by
> definition implementation specific as they start with an underscore.

Yes, it only affect glibc ... in face, I found these macro by tracing
Linux's <sys/stat.h>.
But I still think it's not a bad idea to make g_stat() to have the same behavior
as stat() on Linux.  So we just need to replace stat() by g_stat() and
it will work under Win32,
just like we can use g_fopen() to replace fopen().

KC


>
> --tml
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list
>


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