comp.lang.ada
 help / color / mirror / Atom feed
From: cstein@jarthur.claremont.edu (Clifford Stein)
Subject: Making EXECL Unix call from Ada
Date: 9 Dec 90 19:38:55 GMT	[thread overview]
Message-ID: <10048@jarthur.Claremont.EDU> (raw)

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;

             reply	other threads:[~1990-12-09 19:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-12-09 19:38 Clifford Stein [this message]
1990-12-10 15:51 ` Making EXECL Unix call from Ada David Emery
replies disabled

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