COPY filename.txt CON
Yes. the output is:
[Z:\]copy test.txt con:
one
two
1 file(s) copied.
And in this case again, I have problems. I send the command to cmd.exe via stdin, and the file content is not shown in stdout, but the "1 file(s) copied." remark is shown.
Now I think I understand the problem. CON is the VIO window, not STDOUT ! In the VIO window, "one two" is shown, and the "1 file(s) copied" command is sent via STDOUT. So I have to simulate CON.
In the other direction (see two code fragments above), the same problem occurs. It does not work because cmd.exe waits for input in the VIO window and it does not get any. So after finishing the CON VIO command, the "one two" lines are received and interpretated as user prompt lines.
Is there a virtual file name like CON or NUL where I can write to stdout/read from stdin? Then I could simply change CON to the other expression, if the user wants this behaviour. (I will implement a lot of stored user settings.) I found this list for Windows in the Internet, OS/2 should be the same:
CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9
So there should be two different behaviours the user can choose: modify CON to stdin/stdout or popping up the VIO window like I want to program if a VIO program has been started.