Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 862
    • Issues 862
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 39
    • Merge requests 39
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !1654

gio-tool-trash: Prevent recursion to speed up emptying trash

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Ondrej Holy requested to merge wip/oholy/trash-recursion into master Sep 16, 2020
  • Overview 2
  • Commits 1
  • Pipelines 2
  • Changes 1

Emptying trash over gio trash is a bit slow in comparison to plain rm -r. On my system, it took about 3 min to empty the trash with a folder containing 600 000 files, which is not ideal as rm -r call took just a few seconds. I found that g_file_delete is implemented differently for locations provided by the trash backend. The trash backend prevents modifications of trashed content thus the delete operation is allowed only for the top-level files and folders. So it is not necessary to recursive delete all files as the permission denied error is returned anyway. Let's call g_file_delete only for top-level items, which reduces the time necessary for emptying trash from minutes to seconds...

See: nautilus#1589 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: wip/oholy/trash-recursion