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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.lang.ada:4568 comp.unix.questions:27463 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!jarthur!jarthur.claremont.edu From: cstein@jarthur.claremont.edu (Clifford Stein) Newsgroups: comp.lang.ada,comp.unix.questions Subject: Making EXECL Unix call from Ada Keywords: enscript, laserprinting, Ada, Execl, UNIX Message-ID: <10048@jarthur.Claremont.EDU> Date: 9 Dec 90 19:38:55 GMT Sender: cstein@jarthur.Claremont.EDU Followup-To: comp.lang.ada Distribution: na Organization: Harvey Mudd College, Claremont, CA 91711 List-Id: I'm trying to laser print a file from an ada program by calling the program enscript with the execl function. I've been having problems, though. Sometimes I can print a file, other times I cannot (if it doesn't print, it [enscript] will give me a file not found message). When enscript does print, however, it prints garbage which doesn't resemble my file at all, and it [enscript] won't even print a filename at the top of the printout like it usually does. I've included the source code here, does anyone have any suggestions? (I'm using VADS serial on a Sequent running Dynix) If I compile this program the way it is right now I will get a "/hmc2/guest/lsdada/cliffie/hello4: file not found" even though hello does exist. Please respond via email. Thank you for any help. Clifford Stein with c_strings; use c_strings; with a_strings;use a_strings; with unix_prcs; use unix_prcs; with text_io; use text_io; procedure print is status:integer; name:string(1..23); argv:string(1..33); a_name:c_string; the_name:a_string; nll:character; begin argv(1..33):="/hmc2/guests/lsdada/cliffie/hello"; nll:=ascii.nul; name:="/usr/local/bin/enscript"; status:=execl(name'address,argv'address,nll'address); if status/=0 then put_line("True."); else put_line("False"); end if; end print;