Command line to trash - KDE

This is a discussion on Command line to trash - KDE ; I've created a command line utility that put files in the same Trash managed by KDE. The usage is simple: alias rm='trash' #use trash command instead of removing rm file #put the file in the KDE trashcan If you are ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Command line to trash

  1. Command line to trash

    I've created a command line utility that put files in the same Trash
    managed by KDE.

    The usage is simple:

    alias rm='trash' #use trash command instead of removing
    rm file #put the file in the KDE trashcan

    If you are interested go to:

    http://www.andreafrancia.it/trash

    --
    Andrea Francia

  2. Re: Command line to trash

    Andrea Francia wrote:
    > I've created a command line utility that put files in the same Trash
    > managed by KDE.
    >
    > The usage is simple:
    >
    > alias rm='trash' #use trash command instead of removing
    > rm file #put the file in the KDE trashcan


    Take a look at this project:
    http://homepage.esoterica.pt/~nx0yew/delsafe/


    --

    //Aho

  3. Re: Command line to trash

    J.O. Aho wrote:
    > Take a look at this project:
    > http://homepage.esoterica.pt/~nx0yew/delsafe/

    Interesting, thanks for the link.

    Is a different approach to the same problem.
    While 'trash' provide a extra command that put files in the trash,
    'delsafe' modifies the semantics of the existing commands.

    Apparently 'delsafe' overrides the library calls of unlink, unlinkat,
    rename, open and fopen modifying the semantics of these functions.
    A program that was designed to works with the original functions may not
    work well with the overridden functions.

    The example is the KDE filemanager which as two command:
    - delete file
    - trash file
    Using 'delsafe' these commands becomes:
    - delete file --> trash file in the delsafe trash
    - trash file --> trash file in the KDE trash

    I prefer(*) the 'trash' approach because don't change the semantics of
    the existing program letting the user chose when putting files in the
    trash and when removing them.

    Personally I don't like the model where each deletion should recorded
    somewhere. 'trash' is intended to be used only in interactive shells, if
    a program decides to delete, or trunk a file the information loss risk
    IMHO should be managed in the context of this program.

    Another good feature of 'trash' is that it put trashed files in the
    XFreeDesktop trashcan which currently is supported by KDE and soon will
    be supported by GNOME.


    (*) Sure! I'm the writer of it!

    --
    Andrea Francia
    alias rm='trash' #use trash command instead of removing
    rm -Rfv file #put the file in the KDE trashcan
    http://www.andreafrancia.it/trash

+ Reply to Thread