comp.lang.ada
 help / color / mirror / Atom feed
* Making EXECL Unix call from Ada
@ 1990-12-09 19:38 Clifford Stein
  1990-12-10 15:51 ` David Emery
  0 siblings, 1 reply; 2+ messages in thread
From: Clifford Stein @ 1990-12-09 19:38 UTC (permalink / 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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1990-12-10 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1990-12-09 19:38 Making EXECL Unix call from Ada Clifford Stein
1990-12-10 15:51 ` David Emery

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