Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!sun-barr!oliveb!tymix!tardis!jms From: jms@tardis.Tymnet.COM (Joe Smith) Newsgroups: comp.sys.amiga.tech Subject: Re: I wanna have a DOSGate! Summary: Hardcopy is on Fish Disk #75 Keywords: Citadel, DOSGate, door, bbs Message-ID: <241@tardis.Tymnet.COM> Date: 7 Jun 89 05:35:13 GMT References: <16317@gryphon.COM> <5866@microsoft.UUCP> Reply-To: jms@tardis.Tymnet.COM (Joe Smith) Distribution: na Organization: McDonnell Douglas Field Service Co, San Jose CA Lines: 78 In article <5866@microsoft.UUCP> bradch@microsoft.UUCP (Bradford Christian ms1) writes: >... I also want the ability to log everything the user does with >said program (which might be a shell). Something similar to the Unix tee >would be real nice. >I'll be writing a DOS device handler that can simulate CON: (including the >special packet to switch to RAW: and back). This handler will allow a >program to be run with all of its output going to the serial port and the >console and it's input coming from the serial port or keyboard. Another place to look for ideas: try HARDCOPY.C on Fish Disk #75. The following is an excerpt from its DOC file. OVERVIEW: HARDCOPY is a program that "clones" the CLI output stream and sends it to two places at one time: the normal CLI window, and a file. With it, you can create a hardcopy listing of all the activity that went on in a CLI window. This can be useful for documentation purposes, error analysis, and error reporting. The advantage of using HARDCOPY instead of output-redirection is that you still see the output in the CLI window (as well as capture it in a file). This makes getting a hardcopy listing of an interactive session much easier. HARDCOPY's major drawback is that it only copies text that goes to or from the CLI window; it does not record any of the activity that occurs in programs that open their own Intuition windows. It will, however, record all data entered in CON and RAW windows opened from the CLI window from which a HARDCOPY is being made. USING HARDCOPY: To use HARDCOPY, type: 1> HARCOPY TO where is the name of a file where HARDCOPY will record your CLI session. This can be on disk, in RAM:, or even directly to PRT:. If you are running a program that sets up its own screen and eventually crashes, you can have it use printf() to send diagnostic messages to the CLI window, and have them recorded to a file even if the program crashes before you can flip the screen to look at the CLI window. You can use HARDCOPY to capture the exact input you used to produce an error, so that you can report the error easier (and so people will believe that it really occured). You can HARDCOPY TO PRT: to produce a printed listing of your work as it happens. TECHNICAL NOTES: HARDCOPY is based on MONPROC by Phillip Lindsay of Commodore-Amiga, and is an example of a real-life program that uses his method to monitor the AmigaDOS activity of a process. It was the simplest and most useful example I could think of, but undoubtedly there are others. Phillip pointed out that the pr_PktWait field of the Process structure is used for an alternate taskwait() routine. AmigaDOS calls this routine whenever a process is waiting for AmigaDOS messages to be issued or returned. HARDCOPY installs its own code in this field. This code waits for AmigaDOS packets to arrive, and then signals a monitoring process. This process checks to see if the packet is to or from the CLI window. If it is, it writes the contents of the packet's data buffer to the output file. Then it signals the pr_PktWait routine that it is through writing (via a semaphore). At that point, the packet wait routine returns the packet to the process for its own use. AUTHOR: Davide P. Cervone DPVC@UORDBV.BITNET University of Rochester Computing Center dpvc@tut.cc.rochester.EDU Taylor Hall dpvc@ur-tut.UUCP Rochester New York 14627 (716) 275-2811 -- Joe Smith (408)922-6220 | SMTP: JMS@F74.TYMNET.COM or jms@tymix.tymnet.com McDonnell Douglas FSCO | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms PO Box 49019, MS-D21 | PDP-10 support: My car's license plate is "POPJ P," San Jose, CA 95161-9019 | narrator.device: "I didn't say that, my Amiga did!"