Article View: comp.unix.programmer
Article #981Raw mode on lp - Help!
From: 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.
Technical Details
Message-ID:
<756@demott.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!srhqla!demott!kdqShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!srhqla!demott!kdq From: kdq@demott.COM (Kevin D. Quitt) Newsgroups: comp.unix.programmer,comp.unix.misc,comp.sys.m68k Subject: Raw mode on lp - Help! Summary: high bit stripped 8-( Message-ID: <756@demott.COM> Date: 11 Oct 90 17:54:43 GMT Reply-To: kdq@demott.COM (Kevin D. Quitt) Followup-To: comp.unix.programmer Organization: DeMott Electronics Co., Van Nuys CA Lines: 39