trash-cli icon indicating copy to clipboard operation
trash-cli copied to clipboard

"Non .trashinfo file in info dir" entries when running trash-restore

Open kxkv opened this issue 1 year ago • 1 comments

Describe the bug

When I run trash-restore I get a very long list of Non .trashinfo file in info dir entries.

$ trash-restore
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
Non .trashinfo file in info dir
   0 2024-08-28 15:35:57 /home/onlyme/syncDir/file1.pdf
   1 2024-08-28 15:36:07 /home/onlyme/syncDir/file2.pdf
   2 2024-08-28 15:36:08 /home/onlyme/syncDir/file3.pdf
What file to restore [0..2]:

However, when I check the trash folder, I only see trashinfo files:

$ ls -al ~/.local/share/Trash/info/
total 12
drwx------ 1 onlyme onlyme 536 Aug 28 15:36  .
drwx------ 1 onlyme onlyme  18 Aug 26 19:32  ..
-rw------- 1 onlyme onlyme 121 Aug 28 15:35  file1.pdf.trashinfo
-rw------- 1 onlyme onlyme 341 Aug 28 15:36 file2.pdf.trashinfo
-rw------- 1 onlyme onlyme  88 Aug 28 15:36  file3.pdf.trashinfo

Are you using the latest version of trash-cli? Yes

Have you tried if the bug is present in the latest version of trash-cli? Yes

Operating system:

  • Arch Linux

Expected behavior Not having a long list of Non .trashinfo file in info dir entries when running trash-restore.

kxkv avatar Aug 28 '24 20:08 kxkv

Thank you for your submission.

The problem is clear.

I think that just printing "Non .trashinfo file in info dir" is not informative enough and that printing multiple time the same message "Non .trashinfo file in info dir" is not so useful.

It's ok to notice the user that there is a strange situation in the trash-dirs but the information should either concise or detailed.

A concise information should be something like this.

$ trash-restore
Found a total of 123 non .trashinfo files in trash-dirs. Use `trash-list --find-non-trashinfo` to list them.
   0 2024-08-28 15:35:57 /home/onlyme/syncDir/file1.pdf
   1 2024-08-28 15:36:07 /home/onlyme/syncDir/file2.pdf
   2 2024-08-28 15:36:08 /home/onlyme/syncDir/file3.pdf
What file to restore [0..2]:

The detailed information should be something like this:

$ trash-list --find-non-trashinfo
/Trash-500/info/not-a-trashinfo-file
/Trash-500/info/another-that-should-not-belong-this-dir
...

andreafrancia avatar Sep 06 '24 19:09 andreafrancia