home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / print / sjii.zip / PRNDSK.DOC < prev    next >
Text File  |  1987-03-03  |  13KB  |  397 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                  PRNDSK  Version 1.00
  8.                              A Printer-To-Disk Redirector
  9.           
  10.           
  11.           INTRODUCTION
  12.           ------------
  13.           
  14.           PRNDSK is a utility that redirects output intended for a printer
  15.           or communications port and sends it to a disk file or other
  16.           device.  It is intended to make it easy to capture disk copies of
  17.           printed output and screen dumps.  It can also be used to discard
  18.           printer output by redirecting it to the NUL device, and you can
  19.           even use disk files as "virtual printers" if your computer does
  20.           not have the printer ports you need.
  21.           
  22.           PRNDSK is written for the IBM PC and closely compatible
  23.           computers, running MS-DOS version 2.00 or later.  Although it
  24.           tries hard to be reliable, it is very likely that there are
  25.           computers and programs with which it will not work.  If you have
  26.           problems, or suggestions for improvements, contact the author:
  27.           
  28.                David H. Rifkind
  29.                3993 N. Campbell Ave., #53
  30.                Tucson, Arizona  85719
  31.           
  32.                BIXMail: drifkind
  33.           
  34.           PRNDSK and this document are copyright 1987.
  35.           
  36.           
  37.           SYNOPSIS
  38.           --------
  39.           
  40.           There are three basic formats for the PRNDSK command:
  41.           
  42.                1.   PRNDSK [/C][/F]
  43.                     Displays information about devices currently being
  44.                     redirected, or closes all files (/C), or flushes them
  45.                     to disk (/F) while leaving them open.
  46.                
  47.                2.   PRNDSK device [/C][/F][/N][/T]
  48.                     Displays redirection information about the specified
  49.                     device, or closes its redirection file (/C), flushes it
  50.                     to disk (/F), or sets or clears the transparency mode
  51.                     (/N, /T).
  52.                
  53.                3.   PRNDSK device=filespec [/A][/T]
  54.                     Begins redirecting a device to the file specified.  The
  55.                     /A switch is used to append to an already existing
  56.                     file, and /T to set the transparent redirection mode.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.           "Device" may be one of the following names:
  74.           
  75.                     LPT1 through LPT3        Printer ports 1 to 3
  76.                     COM1 or COM2             Serial ports 1 and 2
  77.                     PRN                      Same as LPT1
  78.                     AUX                      Same as COM1
  79.           
  80.           "Filespec" may be any unambiguous file specification.  Legal
  81.           examples include:
  82.           
  83.                     PRINTER.TXT
  84.                     A:COM1.TXT
  85.                     ..\LISTING
  86.                     C:\DEVEL\PRINTER.TXT
  87.                     NUL
  88.           
  89.           
  90.           REDIRECTING OUTPUT
  91.           ----------- ------
  92.           
  93.           To direct output intended for a printer or serial port to a file,
  94.           enter the following command:
  95.           
  96.                PRNDSK device=filespec
  97.           
  98.           "Device" should be replaced by the name of an output device:
  99.           LPT1, LPT2, LPT3, COM1, COM2, PRN or AUX.  "Filespec" is replaced
  100.           by the name of a file to receive the output.  Here is an example
  101.           of a legal command:
  102.           
  103.                PRNDSK PRN=PRINTER.TXT
  104.           
  105.           This will result in output to the printer being sent instead to
  106.           the file PRINTER.TXT in the current drive and directory.  A drive
  107.           and path name may also be included in the filespec:
  108.           
  109.                PRNDSK COM1=C:\FILES\LOGFILE.COM
  110.           
  111.           In fact, "filespec" may be any MS-DOS file or device name,
  112.           including CON, NUL, or even a printer or serial port!  If output
  113.           is redirected to a serial port or printer port, it is not further
  114.           redirected.  To make this clear (or at least clearer):
  115.           
  116.                PRNDSK PRN=COM1
  117.                PRNDSK COM1=COMM.TXT
  118.           
  119.           In this example, output sent to the PRN device will go to serial
  120.           port number 1; it will NOT go to the file COMM.TXT.
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.           There are two switches which may be included with this form of
  140.           the PRNDSK command.  The /A switch:
  141.           
  142.                PRNDSK device=filespec/A
  143.           
  144.           causes data to be appended to the output file.  If the /A switch
  145.           is not included, the file will be erased before beginning output.
  146.           
  147.           The /T switch:
  148.           
  149.                PRNDSK device=filespec/T
  150.           
  151.           results in transparent output--characters output will go to both
  152.           the redirection file AND to the specified device.  This allows
  153.           you to make both a soft and a hard copy at the same time.
  154.           
  155.           Once redirection to a file is begun, the disk containing that
  156.           file should not be removed.  Close the file (see OUTPUT CONTROL)
  157.           first.
  158.           
  159.           
  160.           OUTPUT CONTROL
  161.           ------ -------
  162.           
  163.           To close an output file and terminate redirection for that
  164.           device, use this command:
  165.           
  166.                PRNDSK device/C
  167.           or   PRNDSK/C
  168.           
  169.           The second version closes all files and terminates all
  170.           redirection.
  171.           
  172.           
  173.           PRNDSK also lets you flush an output file, that is, update the
  174.           file directory information on the disk without closing it.  Make
  175.           whatever use of this that you can:
  176.           
  177.                PRNDSK device/F
  178.           or   PRNDSK/F
  179.           
  180.           
  181.           DEVICE STATUS
  182.           ------ ------
  183.           
  184.           To keep track of what devices you have redirected, PRNDSK will
  185.           show you the status of each device it handles.  To find out to
  186.           what file a given device is being directed, enter:
  187.           
  188.                PRNDSK device
  189.           
  190.           For example:
  191.           
  192.                PRNDSK PRN
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.           
  206.           The reply might be:
  207.           
  208.                LPT1=C:\FILES\PRINTER.TXT
  209.           
  210.           If the device is set for transparent redirection, the file name
  211.           will be followed by a "/T":
  212.           
  213.                LPT1=C:\FILES\PRINTER.TXT/T
  214.           
  215.           If redirection to the file has been stopped due to a DOS error,
  216.           the error message will be shown after the file name:
  217.           
  218.                LPT1=C:\NONESUCH\PRINTER.TXT
  219.                     Path not found
  220.           
  221.           Finally, if the device in question is not being redirected, there
  222.           will be no reply.  To list all devices being redirected, type:
  223.           
  224.                PRNDSK
  225.           
  226.           Note: the way the filename is reported varies slightly with
  227.           different versions of MS-DOS.  In DOS 2.xx, the filename is
  228.           reported exactly as you entered it.  In DOS 3.xx, the complete
  229.           unambiguous filespec is given.
  230.           
  231.                PRNDSK PRN=..\FILES\PRINTER.TXT
  232.           
  233.                DOS 2.xx: LPT1=..\FILES\PRINTER.TXT
  234.                DOS 3.xx: LPT1=C:\SUBDIR\FILES\PRINTER.TXT
  235.           
  236.           
  237.           CHANGING MODES
  238.           -------- -----
  239.           
  240.           A redirected device may be switched into and out of the
  241.           transparent mode using one of the following commands:
  242.           
  243.                PRNDSK device/T          to set transparent mode
  244.                PRNDSK device/N          to clear transparent mode
  245.           
  246.           "/N" is a mnemonic for "not transparent", and deserves an award
  247.           as one of the least mnemonic mnemonics ever.
  248.           
  249.           
  250.           ERROR HANDLING
  251.           ----- --------
  252.           
  253.           If any DOS error occurs while PRNDSK is trying to write to a
  254.           file, the associated device will become "inactive".  Attempts to
  255.           write to the device will generate printer I/O errors (for the
  256.           printer ports) or timeout errors (for the serial ports).  The
  257.           device will remain inactive until it is closed (by PRNDSK/C).
  258.           
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.           
  272.           COMPATIBILITY
  273.           -------------
  274.           
  275.           PRNDSK intercepts the IBM PC's BIOS INT 14h and INT 17h vectors
  276.           (the serial and printer service interrupts).  It may not work
  277.           correctly with other programs which also take over those vectors.
  278.           
  279.           In most cases, PRNDSK will work with printer buffer software if
  280.           it is loaded AFTER that software.  Due to the design of the IBM
  281.           PC's ROM BIOS, a great number of programs that use the serial
  282.           ports will not work with PRNDSK.  However, if your serial ports
  283.           are being used for simple output devices such as printers or
  284.           plotters,  it should work.  Don't be surprised, though, if your
  285.           modem attached to COM2 prevents your using PRNDSK with the
  286.           printer attached to COM1.
  287.           
  288.           
  289.           PECULIARITIES
  290.           -------------
  291.           
  292.           "Peculiarity" is the word we have chosen to describe some of the
  293.           stranger aspects of PRNDSK's operation.  The word "feature" might
  294.           also be used.  Use of the term "bug" is frowned upon.
  295.           
  296.           In order to work correctly with DOS, PRNDSK keeps track of calls
  297.           to the various DOS services.  This allows it to decide when it is
  298.           safe to write to the disk, and when to wait for a better time. 
  299.           It is not always possible to make this decision correctly, so
  300.           PRNDSK adopts a conservative approach: it never writes to the
  301.           disk unless it is quite sure that it is safe.
  302.           
  303.           Under some circumstances, it may be impossible to write to the
  304.           disk for a considerable period of time.  When this happens,
  305.           PRNDSK can lose some characters which were sent to the printer. 
  306.           This is rare, and may happen with some programs and not with
  307.           others.  One simple example which will demonstrate this is:
  308.           
  309.                COPY somefile PRN
  310.           
  311.           where "somefile" is more than about 2K bytes long.  There is no
  312.           apparent good solution for this problem.
  313.           
  314.           Another peculiarity has to do with opening files.  Under some
  315.           circumstances, this sequence of commands:
  316.           
  317.                CHDIR \FIRST
  318.                PRNDSK PRN=PRINTER.TXT
  319.                CHDIR \SECOND
  320.           
  321.           will result in PRINTER.TXT appearing in directory SECOND instead
  322.           of FIRST.  This will happen only (1) when using DOS 2.xx and (2)
  323.           the first time that PRNDSK is run (that is, if PRNDSK is already
  324.           resident in memory, this will not happen).
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.           
  338.           If this behavior causes a problem, you can follow the first
  339.           PRNDSK command with:
  340.           
  341.                PRNDSK PRN/F
  342.           
  343.           which will ensure that the file ends up in the correct directory.
  344.           
  345.           
  346.           PROGRAM NOTES
  347.           ------- -----
  348.           
  349.           This is the first publicly released version of PRNDSK.  There are
  350.           other programs that do about the same thing.  I hope that PRNDSK
  351.           is more reliable and more functional than the others.  I also
  352.           hope that you find it useful.
  353.           
  354.           This first version is fairly rough in several ways.  Since it
  355.           uses a 2K buffer for each of five devices, over 8K of memory is
  356.           wasted if only one is being redirected.  There are also all those
  357.           darned "peculiarities" (see above).  If there is enough interest
  358.           in PRNDSK, I might get ambitious and make improvements.
  359.           
  360.           This is copyrighted material.  No fee is charged for its use. 
  361.           You may reproduce and distribute it as you see fit, but please do
  362.           not distribute modified or incomplete copies.
  363.           
  364.           28 Feb 1987
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.