windows-trash.exe
silently fails to remove files if the path is in a subst
virtual drive.windows-trash.exe
successfully removes the same files if the full, non-virtual drive paths are used.P:\tmp>subst
&REM Show subst virtual drive maping:
P:\: => V:\Insync\Dropbox\p
P:\tmp>windows-trash.exe FILE_TO_TRASH
&REM Running from virtual drive silently fails to remove file:
P:\tmp>dir
06/18/2023 12:15 AM 0 FILE_TO_TRASH
06/17/2023 11:10 PM 28,672 windows-trash.exe
P:\tmp>v:
&REM Switch to non-virtual drive.
V:\Insync\Dropbox\p\tmp>windows-trash.exe FILE_TO_TRASH
&REM Running from non-virtual drive successfully to removes file:
V:\Insync\Dropbox\p\tmp>dir
06/17/2023 11:10 PM 28,672 windows-trash.exe
I was trying to debug or workaround this error:
/p/tmp
$ trash FILE_TO_TRASH
Error: Command failed: V:\pnpm-home\global\5\.pnpm\[email protected]\node_modules\trash\lib\windows-trash.exe P:\tmp\FILE_TO_TRASH
at ChildProcess.exithandler (node:child_process:419:12)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5)
The error does not happen if not in a virtual drive:
/v/Insync/Dropbox/p/tmp
$ trash FILE_TO_TRASH
/v/Insync/Dropbox/p/tmp
$ ls
windows-trash.exe*
Also the error only occurs after trash-cli version 3.0.0. (So my workaround is to use version 2.0.0)
Environment:
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too