Git Product home page Git Product logo

trashy's Introduction

trashy

Build Status

trashy is a simple, fast, and featureful alternative to rm and trash-cli written in rust.

Quick links:

Demo

demo

Features

  • easy to use, just run trashy put PATH
  • recursive by default, without having the issues
  • beautiful output
    • colorized paths (similar to fd)
    • cool tables
  • very fast, and faster than trash-cli (see benchmarks)
  • much safer than rm -rf
  • intuitive syntax and fine grained control
  • uses the system trash on both linux and windows

Usage

Trash a path

$ trashy first second third

This is just sugar for

$ trashy put first second third

List items in the trash

$ trashy list

Restore or empty some files

$ trashy restore first second
$ trashy empty first second third

The restore and empty subcommands both take very similar arguments and flags.

By default the arguments for restore and empty are interpreted as regular expressions. Use the -m option to interpret them differently.

Restore or empty all files

$ trashy restore --all
$ trashy empty --all

Integrations

fzf

Restore with fzf

trashy list | fzf --multi | awk '{$1=$1;print}' | rev | cut -d ' ' -f1 | rev | xargs trashy restore --match=exact --force

Empty with fzf

trashy list | fzf --multi | awk '{$1=$1;print}' | rev | cut -d ' ' -f1 | rev | xargs trashy empty --match=exact --force

Installation

Using cargo

cargo install trashy

From Github Releases

Download the binary from Github Releases and put it in your $PATH.

From the AUR

Use your favorite AUR helper.

paru -S trashy

Using Nix

nix-env -i trashy

Or if you have flakes enabled:

nix profile install nixpkgs#trashy

Benchmarks

These benchmarks are run on the rust compiler source in the compiler/ directory. The directory has about 2000 files. The benchmarks are run using hyperfine.

Running put on each file in the compiler/ directory recursively.

hyperfine -M 1 'fd -t f --threads 1 -x trash-put'
Time (abs ≡):        65.849 s               [User: 54.383 s, System: 11.370 s]

Now with trashy

hyperfine -M 1 'fd -t f --threads 1 -x trashy put'
Time (abs ≡):         4.822 s               [User: 2.014 s, System: 2.918 s]

trashy has practically zero startup time, while trash-cli has a large startup time because it is written in python. This difference in startup time causes massive speed differences when used in scripts. The benchmark shows that trashy is about 13 times faster!

Listing the previously trashed items

hyperfine 'trash-list'
Time (mean ± σ):     383.7 ms ±  10.5 ms    [User: 321.8 ms, System: 59.4 ms]
Range (min … max):   375.9 ms … 412.0 ms    10 runs
hyperfine 'trashy list'
Time (mean ± σ):     178.3 ms ±   1.9 ms    [User: 135.7 ms, System: 40.4 ms]
Range (min … max):   175.6 ms … 181.0 ms    16 runs

trashy is faster by more than 2 times.

FAQ

Is this supported on MacOS?

No, see this issue

Should I alias rm='trashy put'?

You should not. The alias will not be present on other systems and habits are really hard to break. An alternative is to alias trashy put to rt or tp.

License

Copyright (c) 2020 Brian Shu

trashy is distributed under the terms of both the MIT license and the Apache License 2.0.

See the LICENSE-APACHE and LICENSE-MIT

trashy's People

Contributors

almazgaliev avatar dependabot-preview[bot] avatar dependabot[bot] avatar evysgarden avatar mo8it avatar novedevo avatar oberblastmeister avatar perlinm avatar stelcodes avatar vehementham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

trashy's Issues

Feature request: File Size column

Summary

it'd be useful to have a way to list and filter files (--larger-than, --smaller-than) with file sizes.

Example

╭───┬─────────────┬────────┬──────────╮
│ i │ Time        │ Path   │ Size     │
├───┼─────────────┼────────┼──────────┤
│ 3 │ 5 hours ago │ /a.zip │  3.0 KiB │
│ 2 │ 5 hours ago │ /b.zip │ 12.1 MiB │
╰───┴─────────────┴────────┴──────────╯

References

example ncdu output:

--- /home/scarf/.local/share/Trash/files -------------------------------------
                                                   /..
    2.1 GiB [####################################] /foo
  763.4 MiB [#############                       ] /bar

Erro for trash files from differen file system

I'v got error by trying to remove folder from different filesystem then my /home

trash  Videos/Anime
error: Error during a `trash` operation: Unknown { description: "Path: '\"/home/bartolomey/.local/share/Trash/files/Anime\"'. Message: Invalid cross-device link (os error 18)" }

Videos folder is mounted by

mount -bind /mnt/data/Videos $HOME/Videos

zsh completion is broken

When completing with any input on zsh, all I get is the following error:

_arguments:comparguments:327: doubled rest argument definition: *::: :->trashy

I'm using the aur version on arch.

Invalid cross-device link error when using ZFS datasets

I get an error every time I try to trash something when the trash is in another dataset:

cd
touch test
trash test
# error: Error during a `trash` operation: Unknown { description: "Path: '\"/home/dominik/.local/share/Trash/files/test\"'. Message: Invalid cross-device link (os error 18)" }

For reference, I have the following ZFS datasets (there are others, but they aren't relevant):
zfs list -r -o name,mountpoint

NAME                MOUNTPOINT
Home                /home
Home/Illode         /home/illode
Home/Illode/Local   /home/illode/.local

If I run:

cd ~/.local
touch test
trash test

it works fine.

This is also the first application I've encountered that has had an issue due to ZFS. I tried trashy-cli and it works fine.
I'm using Arch with the latest everything and installed from the AUR.

ZSH completions are broken

When trying to autocomplete for files in a directory I get a ZSH completion parsing error (See below).

image

OS: Arch Linux
Package Version: 2.0.0-1
ZSH Version: 5.9-4

Feature request: --date column

As I love trashy output I need sometimes more specific time when I put file/folder in trash. If two days ago something was deleted, then what time it was exactly?

---------------------------------------------------------------------
|  i  | Time            |  Date             |     Path              │
|-----|-----------------|-------------------|-----------------------|
|  2  | 2 days ago      | 2022/09/13 16:45  |  /home/user/blablabla |
|  1  | 2 days ago      | 2022/09/13 16:40  |  /home/user/blablabla |
|  0  | 43 minutes ago  | 2022/09/15 12:01  |  /home/user/blebleble |
---------------------------------------------------------------------

add -y or --yes argu

when i use trash restore --all this command
i always y again

so, you can like this

trash restore --all -y

just one command ,not user second y

macOS Installation problem

Hello there,

Trying to install trashy on my MacBook (Intel processor) but I get the below error:

error[E0433]: failed to resolve: could not find `os_limited` in `trash`
  --> ~/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/trashy-1.0.2/src/app/command/empty.rs:52:12
   |
52 |     trash::os_limited::purge_all(items.items())?;
   |            ^^^^^^^^^^ could not find `os_limited` in `trash`

error[E0433]: failed to resolve: could not find `os_limited` in `trash`
  --> ~.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/trashy-1.0.2/src/app/command/list.rs:64:28
   |
64 |     let mut items = trash::os_limited::list()?;
   |                            ^^^^^^^^^^ could not find `os_limited` in `trash`

error[E0433]: failed to resolve: could not find `os_limited` in `trash`
  --> ~/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/trashy-1.0.2/src/app/command/list.rs:90:36
   |
90 |             let mut items = trash::os_limited::list()?;
   |                                    ^^^^^^^^^^ could not find `os_limited` in `trash`

error[E0433]: failed to resolve: could not find `os_limited` in `trash`
  --> ~/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/trashy-1.0.2/src/app/command/restore.rs:49:12
   |
49 |     trash::os_limited::restore_all(items.items())?;
   |            ^^^^^^^^^^ could not find `os_limited` in `trash`

For more information about this error, try `rustc --explain E0433`.
error: could not compile `trashy` due to 4 previous errors
error: failed to compile `trashy v1.0.2`, intermediate artifacts can be found at `/var/folders/3c/4h7rrmnd2s1cjhqysqk345lm0000gp/T/cargo-installEiaubN`

Thank you ❤️

I have been looking for a way to non-interactively restore the latest trashed file from the command line. Other implementations don't allow this, I'm happy to have found one that does :)

More examples in help/man

I feel puzzled how delete files from bin. I tried:

trash empty

error: Must match something

And then:
trash empty all

0 items will be emptied
╭───┬──────┬──────╮
│ i │ Time │ Path │
╰───┴──────┴──────╯
Are you sure? yes

But everything is still in trash folder. If you could add more info for people without imagination like me, that would be awesome.

Shorter name

trash is too long and doesn't match the project name trashy.

I'm thinking of changing the name to something shorter. Some ideas:

  • th
  • ta
  • tm

Unable to clear trash when deleting dead symlink

Expected behavior

When a dead symlinked file is deleted, it should be able to be cleared from the trash directory

Actual behavior

When a dead symlink is deleted, it correctly goes into the trash directory, but the trash restore/empty commands no longer work as long as the dead symlink is there

Steps to reproduce behavior

touch test
ln -sf test test2

trash put test
trash empty

trash put test2
trash empty

The final command will result in following error

thread 'main' panicked at 'assertion failed: file.exists()', /build/trashy-2.0.0-vendor.tar.gz/trash/src/freedesktop.rs:238:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Feature request: restore all deleted files from last trashy call

I would like to integrate this into a terminal file manager. The main use case I have is deleting a bunch of items (with one invocation of trash) and, if I need to, restoring all files deleted by that one command. From reading the help messages for the options, I don't think this is currently possible. Is this possible right now and, if not, could it be implemented?

Unable to restore files from partial trashing operation

If you begin trashing a large folder and then interrupt the trashing operation you will be unable to restore the files by merging them back into the partially trashed directory. trashy should just attempt to restore files that do not exist and ask when a file restore operation conflicts with an already existent file.

support for trashing multiple files with same extension?

i have a list of 12 different .py files that i want to put in trash.

is this possible directly?

i tried this command:

trash *.py

& got this error:

error: Error during a trash operation: Unknown { description: "windows error: The parameter is incorrect.\r\n" }

i'm on windows 11 using windows terminal bdw.

'trash list' is extremely slow

sudo timeout -s INT 60 flamegraph --freq 3000 -- trash list:

flamegraph

If I let the command complete (takes more than 3 minutes to list 10 trash item indicies) without interruptions:
flamegraph

Should executable be renamed to trashy?

If PR #103 is merged, trashy will no longer be compatible with the trash command from trash-cli. I personally support this change because of the shell completion/simplicity it will bring. But that begs the question, why even name the executable trash at that point? It annoyingly conflicts with trash-cli and does not match the name of the project. Why not rename the executable to trashy? It really doesn't make sense for every reimplementation of the freedesktop trash spec to ship an executable with the exact same name.

I recently submitted a PR to nixpkgs to generate and install man pages for trashy, and I ran across the problem of what to name the man page. Should it be trash or trashy? The man page itself is titled trashy(1) and even displays the help string as having an executable named trashy. But of course that is inaccurate; the executable is actually named trash. I ended up creating both trash.1 and trashy.1 man page files and installing both.

Another issue that comes up is tooling that supports trashing files via shelling out to external commands. For example, in Neovim if you want to write a plugin that searches the user's PATH for a freedesktop trash utility, you have to be really careful about figuring out where the user's trash command comes from. In order to support trashy, you have to write something like this:

  trash_cmd = nil
  if vim.fn.executable("trash-put") == 1 then
    trash_cmd = { "trash-put" }
  elseif vim.fn.executable("gio") == 1 then
    trash_cmd = { "gio", "trash" }
  elseif vim.fn.executable("trash") == 1 and string.find(vim.fn.system("trash --version"), "^trashy") then
    trash_cmd = { "trash", "put" }
  end

Seems like all this confusion could be avoided if the name of the executable is changed to trashy. It's unique and matches the name of the project. Perhaps both the PR #103 and this change could be combined into a single breaking change release to make it easier for users to adjust.

Color doesn't work on Windows

trashy 2.0.0

OS Name:                   Microsoft Windows 10 Business
OS Version:                10.0.19045 N/A Build 19045
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free

Color doesn't appear to work on Windows machines.

image

Feature request: --verbose flag

Hi there, I've been using this program for the last couple of weeks and I've been loving it so far. One of the things I think is missing from rm is a --verbose flag.

I think this flag is super useful for interactive use in the terminal, and I think it would be useful here too. In rm it simply prints the removed files after the fact, like so:

$ touch file file2 file3
$ rm --verbose file*
removed 'file'
removed 'file2'
removed 'file3'

In trashy, I think it could be done similarly, or to maintain consistency with the other subcommands, a confirmation prompt could be used, like how it is already done with the empty subcommand:

$ trash empty file
3 items will be emptied
╭───┬────────────────┬──────────────────────────╮
│ i │ Time           │ Path                     │
├───┼────────────────┼──────────────────────────┤
│ 2 │ now            │ /home/caio/desktop/file  │
│ 1 │ now            │ /home/caio/desktop/file3 │
│ 0 │ now            │ /home/caio/desktop/file2 │
╰───┴────────────────┴──────────────────────────╯
Are you sure? [y/n]

What do you think? Do you think it makes sense adding this flag?
I could help with the development if needed.
Thanks.

Feature request: trash restore should only list items within current directory

Similar to how trash-cli handles restoring items, I would like for the ability to list items within only the current directory from which the command is executed from.

For example, if I am in ~/Downloads, the only items I would like to see from trash restore would be those whose original location was in ~/Downloads.

Using trash restore -d ./ does not work because it no longer prompts for the index of items to restore, but attempts to restore all items.

I've currently forked this repo and removed the check for filters within restore.rs (allowing trash restore -d ./ to still prompt for index) but I'm sure that is not ideal. Willing to consider any better implementations and put in a pull request if that would be helpful.

[fzf script] wrong when File name or directory contains space

Example path:

/home/xxx/xxx xxx/aaa bbb ccc.zip

Original scirpt(failed):

trashy list | fzf --multi | awk '{$1=$1;print}' | rev | cut -d ' ' -f1 | rev | xargs trashy restore --match=exact --force

My modified Version(works):

trash list --rev -d . | fzf --multi | awk '{$1=$1;print}' | rev | grep -o '/home.*' | xargs -r -d '\n' trash restore --match=exact

(I don't know whether root user have trash. It may not work for root user)

Error when using trash to delete something

I just installed trash using cargo, and when I run trash something, I get this error:

error: Error during a `trash` operation: Unknown { description: "Path: '\"/data01/.Trash-1009\"'. Message: Permission denied (os error 13)" }

What does it mean?
/data01/.Trash-1009 desn't exist

run trash empty --all without confirmation

i have removed the trash-cli which provides trash-empty command.
i use that trash-empty command in shell scripts to keep up the system maintenance.
trash-empty doesn't ask for confirmation.

how to replace that command with trash command as it keeps asking for confirmation?

AUR Package

Do you have any plans to create an AUR package for trashy?

Ugly exit from fzf integration

With the provided fzf integration commands, if you run one, but decide to abort the operation, you have to quit twice. Is there a better solution for this?

Incorrect number of items shown through pipeing to `wc -l`

Problem
I am writing a script that first checks if the trash list is empty. My current implementation is trying to read the line count with $ trash list | wc -l, but the command incorrectly reports 1 for both an empty trash directory and one with a single item.

Resolution
$ trash list | wc -l should return different results if the directory is empty vs. contains a single item. Whether an empty directory reports 0 or a single directory reports 2, I am fine with either implementation.

Demonstration
$ cd Desktop
$ touch test
$ trash put test
$ trash list

╭───┬──────┬─────────────────────────╮
│ i │ Time │ Path                    │
├───┼──────┼─────────────────────────┤
│ 0 │ now  │ /home/omer/Desktop/test │
╰───┴──────┴─────────────────────────╯

$ trash list | wc -l

1

$ trash empty --all

1 item will be emptied
╭───┬────────────────┬─────────────────────────╮
│ i │ Time           │ Path                    │
├───┼────────────────┼─────────────────────────┤
│ 0 │ 11 seconds ago │ /home/omer/Desktop/test │
╰───┴────────────────┴─────────────────────────╯
Are you sure? yes

$ trash list

╭───┬──────┬──────╮
│ i │ Time │ Path │
╰───┴──────┴──────╯

$ trash list | wc -l

1

NixOS tab completions don't work at all

I am using zsh with tmux, powerline10k on nixos and whenever I try to tab complete with anything beginning with trash it simply moves the prompt to a new line, this doesn't happen with trash-cli.

Error on `empty` when symlink to unmounted drive present

I accidentally created some symlinks to images in a mounted drive. I deleted them with trashy put. Unmounted the drive and forgot about it. Now I'm trying to empty the trash but I get the error:

error: Error during a `trash` operation: FileSystem { path: "~/.local/share/Trash/files/IMG_20240310_220717_1.jpg.2", kind: NotConnected }

The file ~/.local/share/Trash/files/IMG_20240310_220717_1.jpg.2 is a symlink to an image in the unmounted drive.

I compiled from source and there hasn't been any changes since, so trashy is up to date (v 2.0.0)

Dependencies to trash seem to be wrong

Hi

I used trashy via nix home-manager (23.05 and 23.11 and master) and via cargo install trashy.
In all the dependency to trash is not 3.0.6 but still 2.xx.
Which leads to the crash when removing symlinks.

If you update the version of a dependency I think you should at least also update the minor version of the whole app.
Sticking to 2.0.0 all the time makes it very hard to figure out why my 2.0.0 does not work but if I download it directly from github 2.0.0 works.

In addition a recommended way of installation would be nice. To me it seems downloading from github makes the most sense because using cargo install seems to install an old 2.0.0 version.

NixOS: trash put/restore doesn't work on mounted volumes

Trying to use trash put and trash restore on a mounted volume (mounted on for example /run/media/username/volumename/) seemingly tries to access /run/.Trash-1000 and fails. trash list however works as expected.

Setup

NixOS 24.05.20240323.44d0940 (Uakari) x86_64
nix-channel --list:

Username: username
Mounted BtrFS volume named volumename

Put file in trash

Steps to reproduce

  1. Have an empty trash bin
  2. Navigate to the root directory of a mounted volume under /run such as /run/media/username/volumename/
  3. nix-shell -p trashy
  4. trash list
  5. touch test
  6. trash put test
  7. trash list

Observed

The file test is still present in the directory, and the trash bin is empty. trash list shows no files before or after.

trash put test gives this error:
error: Error during a `trash` operation: Unknown { description: "Path: '\"/run/.Trash-1000\"'. Message: Permission denied (os error 13)" }

Expected

The file test is removed from the directory and is then listed with trash list.

Counterexample

  1. Have an empty trash bin
  2. Navigate to ~/
  3. nix-shell -p trashy
  4. trash list
  5. touch test
  6. trash put test
  7. trash list

Observed

The file test is removed from the directory and is then listed with trash list.

Restore file from trash

Steps to reproduce

  1. Have an empty trash bin
  2. Navigate to the root directory of a mounted volume under /run such as /run/media/username/volumename/
  3. touch test
  4. Use a file explorer to put test into the trash
  5. Confirm that test shows up in the trash bin
  6. nix-shell -p trashy
  7. trash list
  8. trash restore test
  9. Type y and Enter
  10. trash list

Observed

Both before and after trash restore, the file test shows up under the path /run/, missing the media/username/volumename/ path components. The file remains in the trash bin and does not exist in the current working directory.

trash restore test gives this error:
error: Error during a `trash` operation: Unknown { description: "Path: '\"/run/test\"'. Message: Permission denied (os error 13)" }

Expected

The file test is listed with trash list, then is restored to the current working directory and is no longer listed with trash list. The trash bin is empty.

Counterexample

  1. Have an empty trash bin
  2. Navigate to ~/
  3. touch test
  4. Use a file explorer to put test into the trash
  5. Confirm that test shows up in the trash bin
  6. nix-shell -p trashy
  7. trash list
  8. trash restore test
  9. Type y and Enter
  10. trash list

Observed

The file test is listed with trash list, then is restored to the current working directory and is no longer listed with trash list. The trash bin is empty.

shell completions for fish shell don't complete for paths on `trash` command without `put`

pressing <tab> on the trash command only auto-completes for the commands, not the files in the directory. trash put completion works as expected.

i don't know how "clap_complete" works, but you can fix the completion by prepending the line complete -c trash -F to the automatically generated completions.

i only know about fish, but zsh still seems to be broken as of #57.

dropping trash in favor of trash put like suggested in #57 (comment) would obviously work as well, but would be a major breaking change and the loss of a selling point.

Unable to Install trashy on M1 Mac

I am unable to install trashy on my M1 Mac. Here are the details of my environment:

Environment:

Macbook M1 Pro
macOS 14.4.1 (23E224)
Cargo 1.78.0 (54d8815d0 2024-03-26)

Log

...
Compiling trashy v2.0.0
error[E0433]: failed to resolve: could not find `os_limited` in `trash`
   --> /Users/[USERNAME]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trashy-2.0.0/src/app/command/empty.rs:52:12
    |
52  |     trash::os_limited::purge_all(items.items())?;
    |            ^^^^^^^^^^ could not find `os_limited` in `trash`
    |
note: found an item that was configured out
   --> /Users/[USERNAME]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trash-2.1.5/src/lib.rs:295:9
    |
295 | pub mod os_limited {
    |         ^^^^^^^^^^

error[E0433]: failed to resolve: could not find `os_limited` in `trash`
   --> /Users/[USERNAME]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trashy-2.0.0/src/app/command/list.rs:94:28
    |
94  |     let mut items = trash::os_limited::list()?;
    |                            ^^^^^^^^^^ could not find `os_limited` in `trash`
    |
note: found an item that was configured out
   --> /Users/[USERNAME]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trash-2.1.5/src/lib.rs:295:9
    |
295 | pub mod os_limited {
    |         ^^^^^^^^^^

error[E0433]: failed to resolve: could not find `os_limited` in `trash`
   --> /Users/[USERNAME]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trashy-2.0.0/src/app/command/list.rs:100:48
    |
100 |     Ok(process_items(rev, max, filters, trash::os_limited::list()?))
    |                                                ^^^^^^^^^^ could not find `os_limited` in `trash`
    |
note: found an item that was configured out
   --> /Users/[USERNAME]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trash-2.1.5/src/lib.rs:295:9
    |
295 | pub mod os_limited {
    |         ^^^^^^^^^^

error[E0433]: failed to resolve: could not find `os_limited` in `trash`
   --> /Users/[USERNAME]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trashy-2.0.0/src/app/command/restore.rs:66:12
    |
66  |     trash::os_limited::restore_all(items.items())?;
    |            ^^^^^^^^^^ could not find `os_limited` in `trash`
    |
note: found an item that was configured out
   --> /Users/[USERNAME]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trash-2.1.5/src/lib.rs:295:9
    |
295 | pub mod os_limited {
    |         ^^^^^^^^^^

For more information about this error, try `rustc --explain E0433`.
error: could not compile `trashy` (bin "trash") due to 4 previous errors
error: failed to compile `trashy v2.0.0`, intermediate artifacts can be found at `/var/folders/vn/nrjpytk92j5br678y6kpr97m0000gn/T/cargo-installVY63jz`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
...

It seems like the os_limited module in the trash crate is not being resolved correctly. Please advise on how to resolve this issue.

trash empty panics when emptying trashed files from mounted drive

issue

i have a drive mounted on /mnt/drive, using trash empty --all correctly shows me the trashed files, but confirming "y" on the prompt panics

running the same command (trash-empty) with trash-cli prompts me to delete the trash from /mnt/drive/.Trash-1000/ and then correctly empties the trash

stacktrace

thread 'main' panicked at 'assertion failed: file.exists()', /home/may/.cargo/registry/src/github.com-1ecc6299db9ec823/trash-2.1.5/src/freedesktop.rs:238:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
running with RUST_BACKTRACE=1 gives the exact same message, but gives a stack backtrace with RUST_BACKTRACE=full
thread 'main' panicked at 'assertion failed: file.exists()', /home/may/.cargo/registry/src/github.com-1ecc6299db9ec823/trash-2.1.5/src/freedesktop.rs:238:9
stack backtrace:
   0:     0x55aabd23626a - <unknown>
   1:     0x55aabd253e9e - <unknown>
   2:     0x55aabd233465 - <unknown>
   3:     0x55aabd236035 - <unknown>
   4:     0x55aabd2376bf - <unknown>
   5:     0x55aabd2373fb - <unknown>
   6:     0x55aabd237dc9 - <unknown>
   7:     0x55aabd237b22 - <unknown>
   8:     0x55aabd23671c - <unknown>
   9:     0x55aabd237872 - <unknown>
  10:     0x55aabd03da83 - <unknown>
  11:     0x55aabd03db1d - <unknown>
  12:     0x55aabd06a574 - <unknown>
  13:     0x55aabd058361 - <unknown>
  14:     0x55aabd06ac6b - <unknown>
  15:     0x55aabd06aa05 - <unknown>
  16:     0x55aabd05850f - <unknown>
  17:     0x55aabd06b068 - <unknown>
  18:     0x55aabd054a73 - <unknown>
  19:     0x55aabd06fb79 - <unknown>
  20:     0x55aabd22d3ec - <unknown>
  21:     0x55aabd06de15 - <unknown>
  22:     0x7f6104344790 - <unknown>
  23:     0x7f610434484a - __libc_start_main
  24:     0x55aabd03e0b5 - <unknown>
  25:                0x0 - <unknown>

info

$ trash --version
trashy 2.0.0

running on arch, installed via the AUR

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.