From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_20,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b2d562c6050c39d3 X-Google-Attributes: gid103376,public From: John Apa Subject: Re: Redirecting output to a printer Date: 1997/02/27 Message-ID: <3315FB74.62F4@delphi.dasd.honeywell.com>#1/1 X-Deja-AN: 221994358 References: <33110F45.1849@carol.net> To: Jack Lunn Organization: Honeywell DASD Newsgroups: comp.lang.ada Date: 1997-02-27T00:00:00+00:00 List-Id: Jack Lunn wrote: > > How do you redirect output to a printer from within an Ada > procedure (Unix and DOS environments)? > > Creating an Out_File called "lpt1" seems to work in DOS. I'm > just wondering if there is a better way. > > Thanks for your help. On a unix machine I found that it's best to send output to a file in /tmp and then when you're done creating it use a system call (I forget the package/procedure name, but it's system dependent anyway) to fire it off to the printer using whatever command line action you would normally use. The function allows you to execute a command line from within your program. It took a string like "p -o -l -s "\!*" <\!* | lpr -Pps_lps_w14u". Worked pretty good. Hope it helps. -- *********************************** John Thomas Apa Honeywell Defense Avionics Systems Albuquerque, New Mexico. ***********************************