* Redirecting output to a printer
@ 1997-02-23 0:00 Jack Lunn
1997-02-26 0:00 ` Jacob Sparre Andersen
1997-02-27 0:00 ` John Apa
0 siblings, 2 replies; 3+ messages in thread
From: Jack Lunn @ 1997-02-23 0:00 UTC (permalink / raw)
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Redirecting output to a printer
1997-02-23 0:00 Redirecting output to a printer Jack Lunn
@ 1997-02-26 0:00 ` Jacob Sparre Andersen
1997-02-27 0:00 ` John Apa
1 sibling, 0 replies; 3+ messages in thread
From: Jacob Sparre Andersen @ 1997-02-26 0:00 UTC (permalink / raw)
Jack Lunn (jclunn@carol.net) 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.
|__________
I will not claim that this is a better way, but it works (in Unix):
- write the text to a temporary file
- call the C system routine to print the file
('system ("lpr /tmp/print_it")' on a Unix box)
You will have to write a binding to the system routine, but that is not too
hard using the Interfaces.C and Interfaces.C.Strings packages.
Greetings,
Jacob
--
Jacob Sparre Andersen http://www.nbi.dk/%7Esparre/
Center for Chaos and Turbulence Studies Phone: (+45) 39 65 53 51
The Niels Bohr Institute (+45) 35 32 53 05
--
"We need a plan to diverge from", Fesser
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Redirecting output to a printer
1997-02-23 0:00 Redirecting output to a printer Jack Lunn
1997-02-26 0:00 ` Jacob Sparre Andersen
@ 1997-02-27 0:00 ` John Apa
1 sibling, 0 replies; 3+ messages in thread
From: John Apa @ 1997-02-27 0:00 UTC (permalink / raw)
To: Jack Lunn
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.
***********************************
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1997-02-27 0:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-02-23 0:00 Redirecting output to a printer Jack Lunn
1997-02-26 0:00 ` Jacob Sparre Andersen
1997-02-27 0:00 ` John Apa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox