GNOME Bugzilla – Bug 728669
W32: GLocalFile can't measure size of files larger than 2^32 on 32-bit systems
Last modified: 2015-04-16 20:01:33 UTC
It calls g_lstat(), which on Windows just calls g_stat(), which is forced to use 32-bit msvcrt stat even if 64-bit version is available (for ABI compatibility).
Created attachment 274823 [details] [review] W32: use 64-bit stat for localfile size calculation
This is an improved fork of bug 711547, see [1] [1] https://bugzilla.gnome.org/show_bug.cgi?id=711547#c13
Review of attachment 274823 [details] [review]: See the nitpicks. ::: gio/glocalfile.c @@ +2663,3 @@ + if (wfilename == NULL) + { + errno = EINVAL; I do not like much about setting errno directly... @@ +2668,3 @@ + + len = wcslen (wfilename); + while (len > 0 && G_IS_DIR_SEPARATOR (wfilename[len-1])) it should be len - 1 @@ +2671,3 @@ + len--; + if (len > 0 && + (!g_path_is_absolute (filename) || len > g_path_skip_root (filename) - filename)) add some parenthesis here?
I'll remove errno, but everything else is a copy of https://git.gnome.org/browse/glib/tree/gio/glocalfileinfo.c#n1713
Created attachment 300983 [details] [review] W32: use 64-bit stat for localfile size calculation
Review of attachment 300983 [details] [review]: So this also has several months of testing so it should be fine to push it. I'd say let's get the ack from some glib maintainer.
Review of attachment 300983 [details] [review]: Looks good to me
Attachment 300983 [details] pushed as 6a25434 - W32: use 64-bit stat for localfile size calculation