! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Incorrect error appears when emptying trash
Status:
RESOLVED: FIXED

Comments

Description Masato Hashimoto 2011-01-21 09:57:53 CET
Overview:
When there is dir/file in Trash, error "Could not delete file <filename>" appears during emptying Trash but Trash is made empty.

Steps to Reproduce:
1) mkdir test.d and touch test.d/test.txt
2) Delete test.d on Thunar (moved to Trash)
3) Choose 'Empty Trash' on Thunar

Actual result:
Error 'Could not delete file "test.txt".' appeared.
Trash was made empty.

Expected result:
The error should not be appeared.

Build & Platform:
Build 20011-01-21 on Arch Linux

Versions:
git/master

Repeatability:
Always
Comment 1 Jannis Pohlmann editbugs 2011-01-24 19:07:00 CET
I can reproduce it here. It's a bit weird but I'll look into it. 
Thanks for providing the steps to reproduce, they are very helpful and precise.
Comment 2 Jannis Pohlmann editbugs 2011-01-24 19:55:44 CET
The Trash specification that is implemented in GVfs has this to say about erasing directories from the trash:

  "If a directory was trashed in its entirety, it is easiest to undelete it or remove it from the trash only in its entirety as well, not as separate files. The user might not have the permissions to delete some files in it even while he does have the permission to delete the directory!"

This is from the "Implementation notes" section and I guess the GVfs folks decided to implement that way.

Fixed in master and the xfce-4.8 branch:

commit bcdceffe0a292aa6ef24f149b746c9d5f15977be
Author: Jannis Pohlmann <jannis@xfce.org>
Date:   Mon Jan 24 19:52:39 2011 +0100

    Only erase top-level items from trash (bug #7147).
    
    Apparently, the GVfs trash backend only allows top-level directories in
    the trash to be modified. Children can be deleted implicitely but e.g.
    when emptying the trash, only the top-level items may be deleted.
    
    To give an example: g_file_delete() fails for "trash:///test/foo.txt"
    but succeeds for "trash:///test".
Comment 3 Jannis Pohlmann editbugs 2011-02-13 16:04:13 CET
*** Bug 7278 has been marked as a duplicate of this bug. ***

Bug #7147

Reported by:
Masato Hashimoto
Reported on: 2011-01-21
Last modified on: 2011-02-13
Duplicates (1):
  • 7278 Misleading dialog when emptying trash

People

Assignee:
Jannis Pohlmann
CC List:
1 user

Version

Attachments

Additional information