comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: file to printer (spooling)
Date: 2000/03/23
Date: 2000-03-23T19:24:28+00:00	[thread overview]
Message-ID: <38DA6F6C.87820545@averstar.com> (raw)
In-Reply-To: 2000Mar23.131043.1@eisner

Larry Kilgallen wrote:
> 
> In article <8bddei$gmg$1@infosun2.rus.uni-stuttgart.de>, Peter Hermann <ica2ph@iris16.csv.ica.uni-stuttgart.de> writes:
> > we need help:
> > (First of all, our primary goal is portability)
> > We create, write (several ada.text_io.put_line),
> > and close a text file.
> > Thereafter we want to spool that file to the printer
> > in order to let it print asynchronously.
> > How should we do this from within the Ada program?
> > We do need that action from within the running Ada program.
> >
> > Do we need an implementation dependent operating system command call?
> > If yes, what is the name of that call?

> ... Others in this
> group will tell you about Microsoft and Unix.

I would think in most environments where there is a C library around,
importing the "system" routine, and passing it a string like
"lpr myfile.txt" would accomplish the job.  Whether it is "lpr"
or "print" or whatever would vary from one O/S to the next, so
that part of the string should clearly be reconfigurable.

E.g.:

    procedure Print_File(Printer_Program_Name : String; File_Name : String) is
         procedure System_Command(X : String);
         pragma Import(C, System_Command, "system");
    begin
         System_Command(Printer_Program_Name & " " & File_Name);
    end Print_File;

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  reply	other threads:[~2000-03-23  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-23  0:00 file to printer (spooling) Peter Hermann
2000-03-23  0:00 ` Larry Kilgallen
2000-03-23  0:00   ` Tucker Taft [this message]
2000-03-23  0:00 ` Pascal MALAISE
2000-03-23  0:00 ` John J Cupak Jr
2000-03-23  0:00   ` Larry Kilgallen
2000-03-23  0:00   ` Robert Dewar
2000-03-24  0:00 ` Tarjei T. Jensen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox