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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7d6b00835cfb92fc X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: file to printer (spooling) Date: 2000/03/23 Message-ID: <38DA6F6C.87820545@averstar.com>#1/1 X-Deja-AN: 601417173 Content-Transfer-Encoding: 7bit References: <8bddei$gmg$1@infosun2.rus.uni-stuttgart.de> <2000Mar23.131043.1@eisner> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@inmet2.burl.averstar.com X-Trace: inmet2.burl.averstar.com 953839468 25269 141.199.8.164 (23 Mar 2000 19:24:28 GMT) Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 NNTP-Posting-Date: 23 Mar 2000 19:24:28 GMT Newsgroups: comp.lang.ada Date: 2000-03-23T19:24:28+00:00 List-Id: Larry Kilgallen wrote: > > In article <8bddei$gmg$1@infosun2.rus.uni-stuttgart.de>, Peter Hermann 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