trash command from shell doesn’t work on some files, randomly, I ru it through a script and it doesn’t report any fail or error, if I try directly by the terminal it gives an error about a pending operation ( I don’t remember well, I ain’t on Haiku now ), any hint? Does anyone experienced something similar?
Tnx in advance
I’ve frankly never ever used the
trash command before. Didn’t even know it existed…
A quick test here showed no problems. If you happen upon a reproducible test case, you can add a ticket at the bug tracker.
Found the bug, if it is.
That happens when a file is trashed via cli and not restored properly from the trash (dragging out of it instead of selecting restore), if I trash it again with tracker and restore with kind manners the trash cli command works again.
I suppose that once a file goes to Trash it’s added with an attribute with its restoring path that is deleted when restored, dragging out from trash doesn’t remove that attribute.
Aw I wrote this one loooong ago…
Yes the original path is stored as an attribute, and if you move the file manually I guess the attribute isn’t removed.
If you are curious, the attribute is “_trk/original_path” and is checked in https://git.haiku-os.org/haiku/tree/src/bin/trash.cpp#n72. I haven’t found such a check in Tracker when moving to the trash, and it seems line 75 checks if the file is already in the trash, so maybe it’s safe to remove the attribute check?