[comp.binaries.ibm.pc.d] Direct output to two destinations

ccrob@uqvax.cc.uq.oz.au (01/23/91)

Hello all,

I am teaching myself a little bit about C by writing a small utility 
on a PC using MS QuickC. In this utility (call it "foo"), I want to 
specify an output file, and from within foo, interactively run some 
other programs I also specify during foo's execution, with foo spooling 
the entire execution session to both the screen (so I can see what I'm 
doing) and the output file (so I have a record). This would be exactly 
like a logging a terminal session on a larger multi-user machine.

I was wondering if anybody could e-mail me any helps/tips/suggestions/
code or information on a utility like this that may already exist. If I 
haven't provided enough information, let me know and I'll show some code.

Thanks for any help that you may be able to provide.

Cheers,
Rob.

----------------------+-------------------------------------------------------
Rob McMillan          |  E-mail: ccrob@uqvax.cc.uq.oz.au (DTE 050527372000094)
Asst Systems Prog     |  Phone:  +61 07 365 4105          FAX: +61 07 365 4477
The Prentice Centre   |  Post:   University of Queensland, QLD 4072, AUSTRALIA

mcohen@amsaa-cleo.brl.mil (Marty Cohen) (01/24/91)

Mail got to Australia, but bounced for unknown user.

You could hit contrl-prtscrn before you want to collect
output and again when you want to stop.  There are some
free tsr's available on simtel20 that redirect printer
output to a file, but you have to be careful since most
of them are limited to a small amount of output because
of the PC's inability to do disk output at the same time
it is doing a dos command.

Other options available from the same source are concopy
and script, which split standard output (like tee on unix)
allowing one copy to go to the screen and another copy to
a file.  To use script, you just type the command, script,
and it starts a new shell using COMSPEC.  When you are through
you type the command, exit, and then the file is closed
and can be accessed.  Concopy works similarly.
--
Marty Cohen mcohen@brl.mil  {uunet|rutgers}!brl!mcohen
Custom House Rm 800, Phila. PA 19106 (215)597-8377
-- 
--
Marty Cohen mcohen@brl.mil  {uunet|rutgers}!brl!mcohen
Custom House Rm 800, Phila. PA 19106 (215)597-8377