GNOME Bugzilla – Bug 504392
Copying cd's/dvd's using nautilus leaves large iso images in "/var/tmp"
Last modified: 2009-07-29 10:46:58 UTC
Please describe the problem: After inserting a data cd and a desktop icon appearing, right click on it and select "copy". Follow prompts on screen until the new cd has been copied. Note that after the copying has been completed, the iso image created for the copy remains in "/var/tmp". This could (if burning many different cd's/dvd's) fill the systems partition. Either nautilus should clean this out when the copy operation has been completed or user should be prompted to manually remove the iso image, if it is no longer required. Steps to reproduce: 1. Insert a data CD; 2. Right click on the desktop icon of the CD and select "Copy"; 3. Check the "/var/tmp" whether there is an iso image left. Actual results: There is a big iso image left under the category of "/var/tmp". Expected results: If the iso image is no longer required, it should be removed. Does this happen every time? Yes. Other information:
Created attachment 101237 [details] [review] Patch for this bug.
I think this makes perfect sense if the burning went fine.
anyone can review it and commit if it is OK?
(In reply to comment #3) > anyone can review it and commit if it is OK? Certainly not, there's a maintainer who happens to be busy these days. Please bide your time.
So, shouldn't this be: /* remove temporary file */ if (iso_filename == NULL) { remove_file (filename); }
*** Bug 517994 has been marked as a duplicate of this bug. ***
there is indication of why the bug should be closed and the 2.22 changelog has no entry which seems to indicate that has been changed
Created attachment 107271 [details] [review] The modified patch.
why did you close the bug?
the patch has not been committed, who can review and commit it? thanks.
In the file "src/ncb-operation.c", there are some codes as follows: ============================== static void ncb_operation_finalize (GObject *object) { ...... if (operation->priv->iso != NULL) { g_object_unref (operation->priv->iso); operation->priv->iso = NULL; } ncb_operation_temp_files_cleanup (operation); //Here has removed the large iso images ...... } static void ncb_operation_temp_files_cleanup (NcbOperation *operation) { operation->priv->files_for_cleanup = g_list_first (operation->priv->files_for_cleanup); while (operation->priv->files_for_cleanup != NULL) { char *filename = operation->priv->files_for_cleanup->data; remove_file (filename); g_free (filename); operation->priv->files_for_cleanup = g_list_remove (operation->priv->files_for_cleanup, operation->priv->files_for_cleanup->data); } } ============================== ncb_operation_temp_files_cleanup So this bug can be closed.
And the patch for this bug should be removed from the spec.
Please ignore my comment above. Because the function "nautilus_burn_iso_graft_free" in file "src/make-iso.c" really do the removing work. ============================== nautilus_burn_iso_graft_free (NautilusBurnIsoGraft *graft, gboolean cleanup) { GList *l; g_ptr_array_foreach (graft->array, (GFunc)g_free, NULL); g_ptr_array_free (graft->array, TRUE); for (l = graft->remove_files; l != NULL; l = l->next) { if (cleanup && l->data != NULL) { g_remove ((char *)l->data); } g_free (l->data); } g_list_free (graft->remove_files); g_free (graft); graft = NULL; } ==============================
Calling remove_file as in the first patch removes the image right after the creation. It should be removed only if the disc copy operation is finished and we do not want to make another copy. The best way would be to remove it when the operation gets finalized. You are right, the ncb_operation_temp_files_cleanup function will do the job, you only have to add the iso filename to list of temporary files. /* If the iso is temporary and it still exists (i.e. cancel button was not hit while creating the iso) schedule it for removal */ if (iso_filename == NULL && g_file_test (filename, G_FILE_TEST_EXISTS)) { ncb_operation_temp_files_add (operation, g_strdup (filename)); } I discovered another poblem: toc_filename pointer was not initialized causing segfault if you selected image file as target but pressed cancel on the file chooser dialog. Not a big deal, toc_filename = NULL; line must be added.
Created attachment 121351 [details] [review] Remove temporary image file on completion.
The patch above works properly, I tested it on different machines. Is there any chance that this bug will be fixed in near future? It has been open for a year.
nautilus-cd-burner has been replaced by Brasero in the GNOME 2.26 release. If your bug still applies to Brasero, please feel free to re-open the bug, and reassign it to brasero itself.