-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trash-put from non-writable directory copies file to trashcan twice, although reporting an error #133
Comments
version of trash-cli - 0.16.12.28 - using it from a git checkout of that release. I wanted to report the same and found this report. So +1. I did not know about the double-copy, so we have two issues stemming from a common cause - the lack of permissions. I guess what's happening is:
I have a wrapper that asks me if I want to run sudo trash-put FILE - if normal trash-put FILE fails - so in my case the 2nd attempt with sudo deletes the FILE but still bec of the 1st try I end up with a COPY of FILE/DIR (or if FILE is a symlink to a file/dir - it's destination is copied). And once again - for large dirs - since the copy process takes time and you can hear your hdd is doing something heavy... you get spooked that maybe trash-put is deleting sth it shouldn't... and you don't know until you 2-check and diff afterwards. I stopped the deletion/copy process with Ctrl+C and diff-ed to make sure all is intact. I hope I helped. |
does this happen with the newest releases? |
@db-inf the version of trash-cli you mentioned is from 2012. As far I understood the report date if from 2018. As five years have passed, I don't you are still using the Fedora 18 system you mentioned. In any case, I suggest to do not use the trash-cli from many distributions because they are very old, and newer versions of trash-cli are more secure. In order to install the latest version of trash-cli use these commands:
If the problem persist feel free to comment below and I will reopen the issue. |
Thank for your reporting. |
Reporting for trash-cli 0.12.9.14 on XUbuntu 18.04.1. Checked all open and closed issues for duplicates.
Trashing a file from a read-only directory creates both versions of trash-can (.Trash/1000 as well as .Trash-1000) in the top-level directory of the mountpoint, and a copy of the file-to-be-trashed in it both of them, while giving an error message and leaving the original file where it is.
If one version of trash-can pre-exists, trash-put copies the file to that one, realises it cannot delete the original and then creates the other version of trash-can, with another copy of the file in it. And of course still can not delete the original
It can be quite annoying: if you trash a large file you end up with an error message AND 3 copies of the file. The mv command reports an error without making a copy of the file.
Also I don't like the unnecessary write operations associated with copying a file, instead of just moving it out of the way, especially when I consider that file to be not needed anymore.
Here is sample output, executed in the top-level directory of a mountpoint :
The text was updated successfully, but these errors were encountered: