Re: seng a character to printer port...



"google-rambo88" <rambo88@xxxxxxxxx> writes:

Very strange... even though I include all header files... related open()
function...
( #include <sys/types.h> ,#include <sys/stat.h>,#include <fcntl.h> )
I met " `O_DIRECT' undeclared (first use in this function) "


1. You aren't writing to a disk, so there's no reason to be
specifying direct disk access.

2. Regardless, you need to

#define _USE_GNU

before you do your #includes for that symbol to exist.

3. There's also no real reason to be using O_SYNC...

Why I can't write character to /dev/lp0?

1. You can get the system to tell you why things don't work by
calling perror() if a system call fails

2. You opened it RD_ONLY. Why do you expect to be able to write?

I 'd like to know How they are diffrect between /dev/lp0 and /dev.par0 and
/dev/parport0 ?

Take a look at the parport.txt and parport-lowlevel.txt files in the
kernel documentation. The short form is that printers are referred to
as lp.

Now... what are you really trying to accomplish? There's really no
reason anybody needs to send data straight to a printer unless they're
doing something *really* esoteric. It doesn't seem likely from you
questions that whatever you're doing really needs that direct access.
.



Relevant Pages

  • RE: Word and Excel generating Error reports and shut down automati
    ... issue, for whatever reason, ended up being something very odd. ... sudden Word, Excel and IE worked fine. ... I added the printers back one at a ...
    (microsoft.public.word.docmanagement)
  • Re: National Timetable To Go
    ... doesn't sell enough copies any more, and that's the increasing reliance on computer wizardry in travel centres and ticket offices. ... I suspect there's another reason too - it's terribly difficult to get anyone to print the Good Book anymore. ... Personally I blame the reluctance by pretty much every single TOC to publish an even interval timetable with common times for Mondays to Saturdays. ... There are far too many examples of services that leave Little Bungle-in-the-Mire at xx42 for most hours, but then slip to 1441 or something equally stupid, thus depriving the printers of the opportunity to print "and at the same minutes past each hour until". ...
    (uk.railway)
  • Re: All printers stink
    ... The big reason for shotty quality is greed. ... Scanners are another. ... Anyone who claims printers are 10 times more expensive 10 years ago is ...
    (comp.periphs.printers)
  • Re: Dot Matrix Printers...
    ... I have a legit reason to step back into the 1980's and use a DMP printer. ... I suggest you do a bit of research and make sure the ribbons are widely available. ... The older these printers get, the fewer places there will be that have ribbons for them. ... Searching for ribbons just now for each one, Google came up with 966 pages for the Star, but 32,300 for the Epson. ...
    (comp.periphs.printers)
  • Re: 8 bit vs 16 bit to print labs
    ... He says that the reason for dropping to 8 bit is that most photo labs have 8 bit printers. ... The reason you stay 16 bit as much as possible is so that as values are adjusted, there is deeper data to draw from right out to the final version. ... Once all your changes are made, clipping the lower bits off will not show in printing which has a fairly narrow dynamic range. ...
    (rec.photo.equipment.35mm)