Open ale5000-git opened 4 weeks ago
Congratulations! You've just met the File System Redirector.
When a 32-bit binary running on 64-bit Windows accesses certain directories which usually contain 64-bit stuff it's magically redirected to an equivalent directory containing 32-bit stuff. In particular, references to C:/Windows/System32
are redirected to C:/Windows/SysWoW64
.
Your 32-bit command stat 'C:/Windows/System32/OpenSSH/ssh.exe'
is redirected to look for C:/Windows/SysWoW64/OpenSSH/ssh.exe
. But there's no such thing, so you get an error.
If you read all the way through the documentation linked above you'll find that you could have said C:/Windows/Sysnative/OpenSSH/ssh.exe
and it would have worked. But only with a 32-bit binary. With a 64-bit binary that command would fail, so it's hardly a panacea.
And, of course, there are exceptions: subdirectories that aren't subject to redirection. We'd have been disappointed if Microsoft hadn't thrown in some special cases.
There are APIs to work around the problem but I'd prefer not to go down that route. I don't think the additional complexity is worth it.
C:/Windows/System32/OpenSSH
is automatically inside $PATH
as well as C:/Windows/System32
while C:/Windows/Sysnative
isn't, so this redirection break the default executable search (command -v ssh
).
Isn't possible to automatically translate (only inside busybox shell) accesses to the folder C:/Windows/System32
to C:/Windows/Sysnative
using a similar way you use to support linux pathes (/bin/sh
)?
In this way you can avoid the use of Windows API completely.
you can avoid the use of Windows API completely.
Maybe so, but not the complexity.
The best way to avoid the drawbacks of the 32-bit binary on 64-bit Windows is to use the 64-bit binary.
This is what I get with 32-bit BusyBox:
Can it be fixed please?
PS: The file exist.