[mod.computers.vax] Sys$assign for output capture

EVERHART%ARISIA@rca.com.UUCP (02/04/87)

There was a message recently from a fellow who wanted to redirect
program output from terminal to a file.
	A couple of additional options exist, supported by software on
the Fall '86 VAX SIG tapes from the DECUS symposium, and by normal
VMS procedures..
	1. Use the SET HOST/LOG=file feature of VMS (provided you turn
DECnet on) to capture terminal output into a file. Requires you to log in
and run the victim program from a second process but it's clean and
captures any terminal output for you. (If you want to play a lot you can
wire two terminal ports together and use something like VAXnet or Kermit
to do an equivalent thing, but be careful of "huh?" - "what?" loops
by setting /notypeahead so you don't get two LOGINOUTS chattering
continuously...)
	2. Look inside the VMS Gnu Emacs kit. You'll find PTDRIVER and
PYDRIVER and a little Pascal terminal program. By modifying the program
you should be able to duplicate the SET HOST/LOG feature using the
PTDRIVER / PYDRIVER combo and again catch all output to a file.
	3. Create a virtual disk and mount it foreign. The VD: driver
on the tape has been tested at least on Massbus and UDA50 disks and
is there in source. A virtual disk is just a contiguous file on the
real one. If you write to it, then disassociate the file from the
disk unit, you have a file left that has what you wrote. You'll
have to arrange that your QIO$ calls increment the block number
used however to make this work; otherwise your old terminal QIO$ calls
will just keep overwriting (usually) the boot block of your
virtual disk.
	Be careful NOT to allow LOG_IO or PHY_IO privs to your process
while doing tricks like this unless you like to lose boot blocks and/or
file structures. I'd suggest using the first method unless there's some
very good reason to play around, given that the person who wanted to
do this is new to VMS. Often, a pass through TECO will clean up many
weird features of record structure in these log files...

$ MCR TECO /NOI/NOM logfile.log
*EX$$
$
where the $ means ESCAPE, not the dollar character...
You may need VAX/RSX to get that to work on BI processors; on other
VAXen it'll work anyway.
	Glenn Everhart
Everhart%Arisia@RCA.COM