Keith Thompson said:
"C:/tmp.txt" is a valid name for that file, but a name that can't be
used in all contexts.
Keith is, of course, correct here.
Of course, whether or not the command line is the OS is open to debate.
But in general, relying on this hack (using the "wrong" - in the sense
of non-native - separator) can lead to grief.
Yes, I just showed it to you.
Yes, and in fact, I believe it is actually true in some cases that don't
involve the command line.
A bit of background: (modern versions of) Windows is a kernel, and
actually a pretty well built and designed kernel, with, like 12,000
layers of emulation wrapped around it. Based on something I read
recently, apparently the kernel itself only works with backslashes. The
conversion from forward slashes to backslashes occurs in one of the
emulation layers.
The effect of this is that, although rarely necessary, there exist some
situations where you, as an application programmer, can call very
low-level kernel functions (not really APIs, at this level) directly
(rather than through the emulation layers). And if you do so, you can't
use forward slashes; you must use backslashes.