The 4DOS command processor for MS-DOS

4dos, batch commands, grub 4 dos, dos 4, ms dos 4

There exist TEE and Y commands in abundance

GB> I use command line because it is ofter more powerful. [...]

GB> When I first read about [CreateRemoteThread() it] appeared to be
GB> useful in creating something I’ve wanted since OS/2 was
GB> introduced; a ‘Y’ pipe.  For those who don’t know, a ‘Y’ pipe
GB> sends output to two destinations.  

You’re using the wrong terms.  No wonder you couldn’t find what you
wanted, despite the fact that such utilities have existed and been
widely available (for OS/2 at least) for over a decade.  

What you actually want is a ‘T’, not a ‘Y’.  A ‘T’ sends what it
receives on its standard input to one or more different places,
including its standard output.  A ‘Y’ combines its standard input with
zero or more other files into a single stream which it sends to its
standard output.  Utilities to perform ‘T’ connections usually go by the
name of "TEE".  Had you looked for that name, you would have found them
years ago.  

In the case of OS/2, for example, there are three sets of 32-bit TEE
utilities:  The command interpreters from JP Software, 4OS2 and TCOS2,
have a TEE command built in to them; there are (several) ports of the
GNU (and FreeBSD) "tee" command to OS/2; and there’s a TEE command
written from scratch for OS/2 in the free OS/2 Command Line Utilities.

( There are also 32-bit ‘Y’ utilities for OS/2, going somewhat
unsurprisingly by the name of "Y".  Again, JP Software’s 4OS2 and TCOS2
have Y as a built-in command.  And again, and there’s a Y command
written from scratch for OS/2 in the free OS/2 Command Line Utilities.
The equivalent "Unix-style" utility in this case, albeit with a slightly
different modus operandi, goes by the name of "cat", and there are
several ports of that from GNU and BSD as well. )

If you are looking for Win32 TEE and Y commands, then you have a choice
between three other sets of utilities: the JP Software command
interpreters for Win32 – 4NT and TCWIN32 – have built-in TEE and Y
commands just like 4OS2 and TCOS2 have; the Microsoft Windows NT
Resource Kit provides both Win32 and POSIX flavours of "tee" and "cat"
commands; and there are ports to Win32 of the GNU "tee" and "cat"
utilities, although one has to expend a little effort to hunt them up.
(In the latter two cases one again has the slight difference in how one
uses "cat" to how one uses "Y" to achieve the same end result.)

GB> The problem with any implementation of this under Windows/Dos
GB> is that the pipes are not multiprocessed.   The program runs but
GB> all output is sent to a temp file.  The pipe is then run with all
GB> input coming from the temp file.  The file is then erased.  The
GB> stick is that you have to wait until execution is complete to
GB> see ouput.  

Then don’t use DOS-Windows, where the native command interpreter is a
DOS program that has no knowledge of pipes or multitasking and thus has
to fake the appearance of them using temporary files.  Use OS/2 Warp or
Windows NT, where the native command interpreters are OS/2 and Win32
programs that know all about pipes and multitasking, and that thus run
both sides of a command pipeline in parallel as separate processes,
connecting them through real pipes that are provided by the operating
system.  There are no temporary files, and there is no waiting for the
left-hand side of the pipeline to finish before one starts to see output
from the right-hand side.

The problems that you describe are nothing to do with how one would
implement the TEE and Y commands, and everything to do with the fact
that you are still using a DOS program as your command interpreter.

.
posted by admin in Uncategorized and have No Comments

Comments are closed.