Thread View: comp.unix.programmer
2 messages
2 total messages
Started by Kevin D. Quitt
Thu, 11 Oct 1990 17:54
Raw mode on lp - Help!
Author: Kevin D. Quitt
Date: Thu, 11 Oct 1990 17:54
Date: Thu, 11 Oct 1990 17:54
39 lines
1228 bytes
1228 bytes
I need to dump out a file to the printer, which file contains
characters that have the high bit set (for graphics). I'm running on a
Motorola Delta 3600, SYSV R3V5.1. Why doesn't the following work?
#include <sys/lprio.h>
#include <stdio.h>
#include <sys/fcntl.h>
char buffer[ 4096 ];
void main()
{
int lp, file, bytes;
struct lprio lpr;
lp = open( "/dev/lp147", O_WRONLY, 0600 );
if ( lp == -1 )
exit(1);
ioctl( lp, LPRGET, &lpr );
lpr.ind = 0;
ioctl( lp, LPRSET, &lpr );
ioctl( lp, LPRRAW, &lpr );
file = open( "/usr/spool/uucppublic/prntscrn", O_RDONLY, 0 );
while ( bytes = read( file, buffer, sizeof( buffer )))
write( lp, buffer, bytes );
close( file );
close( lp );
}
Thanks in advance.
Re: Raw mode on lp - Help!
Author: tim Tim Dawson
Date: Mon, 15 Oct 1990 21:08
Date: Mon, 15 Oct 1990 21:08
28 lines
1559 bytes
1559 bytes
kdq@demott.COM (Kevin D. Quitt) writes: > I need to dump out a file to the printer, which file contains >characters that have the high bit set (for graphics). I'm running on a >Motorola Delta 3600, SYSV R3V5.1. Why doesn't the following work? ... > lp = open( "/dev/lp147", O_WRONLY, 0600 ); ... Well, I hate to tell you this, but this device has been given a number of "Features" that may make this impossible such as: 1) A maximum page width of something like 128 columns 2) Form Feed after a page 3) As I recall, the driver also will only pass 7 bit characters, and then only those which are eprintable or are recognized controls. I short, they attempted to implement some desireable features in the driver instead of in lp where they belong. There is a workaround for the column width problem, and maybe for the form feed, but the last time I pursued this, running graphic character codes out this device is still very painful if not impossible. -- ================================================================================ Tim Dawson (...!texsun!Athena!MIS1!tim) Motorola Computer Systems, Dallas, TX. "God gave me a brain and I give Him the glory by using it!"
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads