GithubHelp home page GithubHelp logo

Delete to recycling bin? about gdu HOT 2 OPEN

dundee avatar dundee commented on June 15, 2024 3
Delete to recycling bin?

from gdu.

Comments (2)

moritzdietz avatar moritzdietz commented on June 15, 2024 1

Thought: Your disk layout is as follows

$ df -h /root
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        5G   2G   3G  60% /root

and you go ahead and as root delete a postgres database with 20GB from /var/lib/postgresql/.
This will fill up your /root/ partition to 100%. This needs to be taken into account when offering a feature like this.

from gdu.

dundee avatar dundee commented on June 15, 2024

What is needed to be done:

  • create new enum DeleteAction of type uint8 which will consist of items: ActionDelete, ActionEmpty and ActionMoveToTrash in package tui
  • modify handleDelete, confirmDeletion and deleteSelected to accept DeleteAction instead of boolean shouldEmpty
  • add new key-binding D (big letter d) to tui/keys.go which will call ui.handleDelete(ActionMoveToTrash)
  • add function MoveItemToTrash to pkg/analyze/file.go:
    • this function should create trash item according to the trash spec, so create a text file in info (e.g. ~/.local/share/Trash/info) and move the item into files.
    • it should respect the setting of XDG_DATA_HOME env variable
  • add the new key-binding to help
  • cover all the functionality by tests (every line, that could be tested, should be tested)

from gdu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.