Date: Mon, 19 Jan 1998 11:41:06 +1030 From: Mike Smith <mike@smith.net.au> To: Randall Hopper <rhh@ct.picker.com> Cc: emulation@FreeBSD.ORG Subject: Re: DOSCMD: How do you set up printing? Message-ID: <199801190111.LAA00349@word.smith.net.au> In-Reply-To: Your message of "Sun, 18 Jan 1998 17:37:24 CDT." <19980118173724.32263@ct.picker.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> QUESTION #2: > > How do you set up printing for LPT1:? > > > SUMMARY : I'm having 3 basic problems: > (1) "assign" device -to- DOS device correspondence > (2) Timeouts > (3) Mystery form feeds > > MORE DETAIL : > > (1) > I added this to my doscmdrc: > assign lpt1: direct /dev/lpt0 > > but when I tried "copy con:lpt1:", typed some text, and hit EOF (F6), I got > a number of: > > /dev/lp0: No such file or directory > > So I tried changing the assign to "lpt0:" (man page says its OK), but > DOSCMD didn't take it and numbering starts at 1 in DOS anyway, so > guess that's a man page typo. Your assign syntax is incorrect. The doscmd configuration parser is an obscene and thoroughly disgusting piece of code. The correct syntaxes are: assign <dos-device> direct assign <dos-device> <printer-name> [<timeout>] In the first case, the dos device is directly associated with a local printer. There is an error in int17.c:open_printer() where it uses / dev/lp%d rather than /dev/lpt%d, which is why you see the error message. > Returning to: > assign lpt1: direct /dev/lpt0 > > I tried "copy con:lpt2:" which, after 30 seconds, printed my output. Any attempt to output to a printer that has not been assigned will result in the output being queued to the default printer. Because there's no "end of print job" indication from DOS programs, doscmd waits until nothing has been printed for a while and then assumes that the program has finished printing and commits the job. This is a standard technique for printer redirectors and spoolers; some also support a magic hotkey for expediting print output, which you could add fairly easily. > (2) > Then, playing with this odd combination (assign lpt1, actually use LPT2:), > I had problems with timeouts. I'd really prefer no queuing or a very short > queue interval -- that is, send it immediately. So I tried: > > assign lpt1: direct /dev/lpt0 1 > > And it was still 30 seconds until I saw my output. A 0 timeout did the same. Your assign on lpt1: has no effect on lpt2:, which is operating in "queue to default printer" mode. If you want to reduce the timeout for lpt2:, you want assign lpt2: 10 Don't go below 5-10 seconds, as even a brief pause may cause your print job to be split and thus ruined. > (3) > > Finally, each 30 second flush always printed and ejected the page, as if > some S/W were injected a formfeed (^L) character in there on a flush. Is > there a way to suppress this spurious formfeed? This may be an issue with your printer configuration, or with the DOS application. There is nothing in doscmd that will insert a formfeed when a job is flushed. To perform a queued print job, doscmd simply forks off "lpr -P <printer>" and feeds data printed to it. After the timeout, it closes the pipe, which causes lpr to commit the job. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801190111.LAA00349>