Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

TYPE ... ?

May
12,957
172
The file C:\Windows\Tasks\SA.DAT has 6 bytes: 06 00 00 00 02 03 (from LIST /X).

When I TYPE it several times I'd expect the same (perhaps nonsense) result each time but I get the likes of this.

Code:
c:\windows\tasks> type SA.DAT
*sY
c:\windows\tasks> type SA.DAT
.DAT
c:\windows\tasks> type SA.DAT
*sT
c:\windows\tasks> type SA.DAT
*si
c:\windows\tasks> type SA.DAT
.DAT
c:\windows\tasks> type SA.DAT
pe
c:\windows\tasks> type SA.DAT
\AT
 
I think the NUL byte is interpreted as the end of a string, and past the end of the string... is just whatever happens to be in memory.

TYPE /X works as I would expect.
 
A corollary to GIGO (Garbage in Garbage out) says "unexpected input gives unpredictable output". If memory serves, I first heard that from a computer science professor in 1968.
 

Similar threads

Back
Top