GNOME Bugzilla – Bug 520046
copying files to full iPod leaves 0-byte files scattered on the device
Last modified: 2010-05-22 11:56:42 UTC
Please describe the problem: Attempting to copy files to an iPod without enough space left will leave 0-byte copies of the files in the /iPod_Control/Music hierarchy. Steps to reproduce: 1. Attempt to copy files to a filled iPod. 2. The files will fail to copy to the iPod (with an error message for every single file, but that's another bug) Actual results: 0-byte placeholders with the filenames of the non-copied files will appear scattered about in /iPod_Control/Music/foo Expected results: No 0-byte files should appear. (This is presumably taking up some small amount of space on the iPod as well so it would eventually cause a more serious problem.) Does this happen every time? Not sure. Other information: 8GB nano of the last "long" shaped generation, Ubuntu 7.10. iPod was configured with iTunes/win32.
*** Bug 556754 has been marked as a duplicate of this bug. ***
See a description of his problem and a solution outline at http://www.mail-archive.com/rhythmbox-devel@gnome.org/msg06242.html
Created attachment 147353 [details] [review] proof of concept patch against rb-removable-media-source.c fixing the bug.
Review of attachment 147353 [details] [review]: not sure why it took me so long to get to this - I thought I had some concerns about it, but it turns out I don't. ::: sources/rb-removable-media-source.c @@ +319,3 @@ +/* from plugins/ipod/ipod-helpers.c */ + +static guint64 get_fs_property (GFile *file, const char *attr) Rather than having two copies of this, we should just have one in lib/rb-file-helpers.c @@ +350,3 @@ + + /* Check remaining space on the destination device */ + guint64 size = 0; variable declarations go at the top of the block, not for any particular reason, but for consistency @@ +351,3 @@ + /* Check remaining space on the destination device */ + guint64 size = 0; + for (l = entries; l != NULL; l = l->next){ likewise a space between ) and { @@ +364,3 @@ + RBRemovableMediaSourcePrivate *priv; + priv = REMOVABLE_MEDIA_SOURCE_GET_PRIVATE(source); + GFile * root = g_mount_get_root(priv->mount); .. and everywhere between functions and their arguments @@ +370,3 @@ + if (size > dest_size){ + char * mount_name = g_mount_get_name(priv->mount); + rb_error_dialog (NULL, _("Error transferring tracks"), _("Not enough space in %s"), mount_name); should include some details here - at minimum, the amount of additional space required on the device
fixed in commit 0c2876b4 - now the transfer just stops when the device is full.