[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: printing



In article <[🔎] m0xspAr-0007zaC@westgac3.dragon.com>,
 <tko@westgac3.dragon.com> wrote:
>Question for the C crowd: I have a program which I wish to print an ordered
>text file. In the Linux Programmers Guide, the printer chapter shows how to
>directly talk to the printer port. I'd like to be able to send the text to the
>appropriate printer filter (and spooler). How would one go about doing that?

  FILE *fp;

  fp = popen("lpr", "w");

  fprintf(fp, "Hello world\n");

  pclose(fp);

See the manual page for popen()

Mike.
-- 
 Miquel van Smoorenburg |  The dyslexic, agnostic, insomniac lay in his bed
    miquels@cistron.nl  |  awake all night wondering if there is a doG


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: