Bugzilla – Bug 114914
cannot empty trash can for removable media
Last modified: 2005-09-08 20:02:06 UTC
When trying to copy a small file to my USB memory stick via drag and drop, I got the message that there's not enough freespace (correct). So I used the popup to move one large file from the stick into the trash can (icom animated to full trash can). However when I tried to empty the trash can, the icon did not change, and subsequent attempts to copy the file to the stick brought the same "not enough space" message, even though there was enough space at that time. Eventually copy per commandline succeeded. So I guess there's something wrong with freespace caching and trash can administration.
looks like dublicate of 114473
Inspecting .xsession-errors I found these "interesting" lines that might be related: resapplet:15759): Glib-GObject-CRITICAL **:g_object_unref: assertion `G_OBJECT (object)' failed ** (nautilus:15773): WARNING **: destroyed file still being monitored
Federico has been looking at related removable media trash problems.
OK, the problem is that nautilus-trash-directory connects to "volume_pre_unmount" in the master GnomeVFSVolumeMonitor only, but not to "volume_unmounted". It assumes that all unmounts will be initiated from Nautilus itself. When you unplug a USB drive, GnomeVFSVolumeMonitor gets notification from gnome-vfs-daemon that a volume was unmounted. Since this event was initiated from the outside, it of course doesn't have a chance to emit the "volume_pre_unmount" signal.
With a little patch to connect to "volume_unmounted", the trash window indeed changes when I unplug the drive. However, instead of the trashed files disappearing, they just change their icons into the one corresponding to "no icon for this file". I guess something is wrong in nautilus-merged-directory or thereabouts. I'll keep looking.
Created attachment 48866 [details] nautilus-114914-trash-unmount-removable-volume.diff This is my patch so far. With it, the Nautilus trash window notices that the removable drive has been unplugged, but it doesn't refresh the icons properly. I'm tracing the code that does that.
Created attachment 49006 [details] Updated nautilus-114914-trash-unmount-removable-volume.diff With this newer patch, the Trash window removes the stale icons. It doesn't update the item count in the window's status bar, however - I don't know yet why it doesn't do that. However, I get a crash if I re-insert the USB drive after pulling it out.
Uh, I may be hitting http://bugzilla.gnome.org/show_bug.cgi?id=307288 (this is the Nautilus from beta2). See the discussion in http://bugzilla.gnome.org/show_bug.cgi?id=171073
Yesterday I found out that the ".Trash" folder on the memory stick also has the username appended. For a media where the filesystem has no "owner" concept (like FAT) this doe not make sense, as any user "having" the stick can delete anything. It just wastes space.
About comment #9 - I agree, but that's more or less irrelevant to this bug. We'll fix that later. Can you please file a bug for that, so that it doesn't get forgotten?
Created attachment 49114 [details] Another update for nautilus-114914-trash-unmount-removable-volume.diff No functional changes from the last version of the patch, but this is in line with the Nautilus coding style. I haven't been able to find why the Trash window doesn't update the item count in the status bar after the drive gets removed. [The assertion failre was a false alarm; with nautilus-2.12.0 this doesn't happen anymore.] See http://bugzilla.gnome.org/show_bug.cgi?id=171073#c36 for the details of the incorrect item count.
OK, the Nautilus maintainer accepted my patch. It is committed upstream now, and should appear in nautilus-2.12.1. I'll add the patch to our 2.12.0 package in the meantime and mark this bug as fixed. This leaves the "wrong item count" to be fixed; that's http://bugzilla.gnome.org/show_bug.cgi?id=46200
OK, submitted to autobuild. You'll get this patch in nautilus-2.12.0-5 or later.