Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!samsung!munnari.oz.au!brolga!uqvax.cc.uq.oz.au!ccrob From: ccrob@uqvax.cc.uq.oz.au Newsgroups: comp.sources.wanted Subject: Code for logging a PC work session Message-ID: <1991Jan23.085524.15266@uqvax.cc.uq.oz.au> Date: 22 Jan 91 22:55:24 GMT Lines: 29 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 have attempted solving the spooling problem by duplicating file handles so that stdout and stderr both point to the output file. This (naive) approach failed dismally (as one would expect). I have seen an OS/2 implementation using pipes, but I am unsure how to work this in QuickC. 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