GNOME Bugzilla – Bug 338893
nautilus reports only up 2gb for the filesize whith large files over ftp
Last modified: 2006-05-11 16:15:42 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/nautilus/+bug/39794 "Connect to an FTP server with large files (larger than 2GB, I used 4.7GB). nautilus will report these files as being 2GB insize, after transferring them it will also use this number for the progress bar and apear to hang at 2gb, since it looks finished.. but it still needs to transfer more data (2.7gb in my case) I've noticed this in dapper drake" example: $ gnomevfs-ls ftp://ie.releases.ubuntu.com/ubuntu-cdimage/releases/5.10/release | grep amd64.iso ubuntu-5.10-dvd-amd64.iso (Regular, application/x-cd-image) size 2147483647 lftp about the same .iso: "-rw-rw-r-- 1 1000 1000 3075670016 Oct 12 2005 ubuntu-5.10-dvd-amd64.iso"
in modules/ftp-method.c, changing the strtol in if (strlen (ls) > 35) { file_info->size = strtol (ls + 35, NULL, 0); file_info->valid_fields |= GNOME_VFS_FILE_INFO_FIELDS_SIZE; } to strtoull will probably help (dunno if it will compile on all platforms we support though :-/)
strtoull doesn't make a difference
Let's try s/atol/atoll in gnome-vfs-parse-ls.c:627 then ;) /* Common file size */ if (!is_num (columns[idx2])) goto error; s->st_size = (gsize) atol (columns [idx2]);
with that change: "... Size : 3075670016 Blocks : 13256429026312501376 ..." Blocks has still a weird value but the size is correct
Created attachment 64712 [details] [review] gnome-vfs2-171156-ftp-large-files.diff This is the patch which I'm using for the corresponding bug in the Novell bugzilla. - Fixes parsing of the file size, with atoll() and an atof() fallback. - Fixes the things we check for in configure.in. - Fixes the usage of the HAVE_STRUCT_STAT_* macros.
Committed to the HEAD and gnome-2-14 branches. 2006-05-02 Federico Mena Quintero <federico@novell.com> Fix http://bugzilla.gnome.org/show_bug.cgi?id=338893: file size is reported wrong in the FTP method for files larger than 2 GB. * configure.in.orig: Check for atoll() to AC_CHECK_FUNCS(). Check for stat.st_blksize stat.st_rdev, and AC_STRUCT_ST_BLOCKS (without these, we were never entering the corresponding #ifdef blocks in gnome-vfs-parse-ls.c, and thus not filling in certain fields of struct stat). * libgnomevfs/gnome-vfs-parse-ls.c (gnome_vfs_parse_ls_lga): Use atoll() when available for stat.st_size, or atof() if it's not available. Use HAVE_STRUCT_STAT_ST_RDEV, HAVE_STRUCT_STAT_ST_BLOCKS, and HAVE_STRUCT_STAT_ST_BLKSIZE instead of HAVE_ST_RDEV, HAVE_ST_BLOCKS, and HAVE_ST_BLKSIZE, respectively.