rushsteve1/trash-d

unable to trash special files on a different filesystem from TRASH_D_DIR

ninedotnine opened this issue · 2 comments

for example, trying to trash a pipe:

» mkfifo pipe
» ls -l
|rw-r--r-- 1 0 dan dan 23 mai 18:17 pipe|
» trash pipe 
trash: path was neither file or directory
trash: /media/trash/files/pipe: No such file or directory
» rm pipe
» ls -l 
»

This apparently only happens when TRASH_D_DIR is on a different filesystem from the file.

This apparently only happens when TRASH_D_DIR is on a different filesystem from the file.

Interesting, there are a lot of special cases for this because you can't rename across filesystems.
This might be related to #6 and is definitely related to #1

Weirdly this seems to be the "correct" behavior by some definitions. trash-d functions more like cp or mv than rm internally (since it's really moving files to the trash bin) so imagine this scenario:

$ # My /tmp is on a different partition than my home
$ mkfifo /tmp/pipe
$ cp /tmp/pipe ~/Desktop

And... cp just hangs forever instead of copying. Oddly mv can do it just fine, so something weird is going on here. This is with coreutils 9.1, not sure if the issue is present with other versions.

From my brief experiments I can get it to mimic cp and just hang, which isn't too helpful. Instead I think I'll make the error message more useful and just call it at that.