[mod.computers.vax] dump listings

KFL%MX.LCS.MIT.EDU@MC.LCS.MIT.EDU.UUCP (07/11/86)

    From: CCFD8%UK.AC.SUSSEX.VAX2@ac.uk

    how DO you get 80 col. Dump listings in a file?
    Brian William

   With V4, you can simply do SET HOST 0 /LOG and do DUMP normally,
and it will be in your log file.
  The method I got to work under V3 involved DECnet 'network process'
access back to your own host.  There is a way to pass commands back
and forth and capture the output in a file.  I will be glad to explain
further if you have V3.
								...Keith

carl@CITHEX.CALTECH.EDU.UUCP (07/13/86)

>   From: CCFD8%UK.AC.SUSSEX.VAX2@ac.uk
>
>   how DO you get 80 col. Dump listings in a file?
>   Brian William

You can do so using mailboxes.  If you don't have the PRMMBX priv, creating
a mailbox that stays around long enough to be useful with DCL commands can
be a little tricky, but the following works well for me:
------------------------------------------------------------------------------
/* crembx.c -- Create a temporary mailbox then wait 10 seconds
 * 	       First argument, if any, is mailbox size
 */
#include <descrip.h>
main(nargs, args) 
int nargs; 
char **args;
{  long chan;
   long len = 80;
   $DESCRIPTOR(devname, "MAILBOX");

   if (--nargs > 0)
      len = atol(*++args);
   SYS$CREMBX(0, &chan, len, 0, 0, 0, &devname);
   sleep(10);
}
------------------------------------------------------------------------------
$! crembx.com -- make a 'permanent' temporary mailbox
$ crembx:==$$users:[carl]crembx
$ spawn/nowait crembx 80
$ wait 0:0:5.0
$ open/read/write/share=write pipe mailbox:
------------------------------------------------------------------------------
The .COM file spawns a subprocess running CREMBX.EXE, created by compiling
and linking the C program.  This program creates a temporary mailbox with
the logical name MAILBOX in the process logical name table, then sleeps
for 10 seconds.  The parent process, after spawning, sleeps for 5 seconds,
then opens a channel to the mailbox.  When the subprocess wakes up and dies,
it deassigns its channel to the mailbox, but since we've got another open,
the temporary mailbox doesn't go away.  Now you can get dump to do 80-column
output to a file with the commands:
	$ SPAWN/NOWAIT/OUTPUT=PIPE: DUMP filename
	$ COPY PIPE: filename.dmp
My use of the logical name PIPE is due to the fact that I originally wrote
the program for creating 'permanent' temporary mailboxes so that I could
have a reasonable approximation of UNIX pipes under VMS without the CSHELL;
the DUMP application was completely fortuitous.