Unable to clear trash when deleting dead symlink
Closed this issue ยท 5 comments
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
The same was happening to me.
This issue is an issue with trash, but it was corrected by this commit. So updating trash dependency version from 3.0.1 to 3.0.2 should solve the issue. At least I have tried, and it solved my case.
This issue is an issue with trash, but it was corrected by this commit. So updating trash dependency version from 3.0.1 to 3.0.2 should solve the issue. At least I have tried, and it solved my case.
Completed by #101. I think we can close this issue.
Similar thing happened to me on trashy 2.0.0:
[I] โ ~ trash empty bash
3 items will be emptied
โญโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโฎ
โ i โ Time โ Path โ
โโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ 2 โ 7 months ago โ /home/xxx/.bashrc โ
โ 1 โ 7 months ago โ /home/xxx/.bashrc โ
โ 0 โ 7 months ago โ /home/xxx/.bashrc โ
โฐโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโฏ
Are you sure? yes
thread 'main' panicked at 'assertion failed: file.exists()', /home/runner/.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
The three files are all dead symlinks.
Pls reopen
Any idea when this will be incorporated in a new release?