Re: Gprolog 1.4 exec/5 does not work under cygwin

Daniel Diaz <[email protected]> Tue, 13 Dec 2011 18:54:50 +0100
Newsgroups gmane.comp.gnu.prolog.bugs
Message-ID <[email protected]>
Hello Mark,

A first remark without looking at details...

The gprolog version you downloaded is a native Windows app. It does
not know nothing about cygwin.

In particular bash or /bin cannot be resolved.

You can try passing 'c:/cygwin/bin/echo abc' to see if it is better.

For instance try:

exec('dir', I,O,E,P), repeat, get_char(O,T), write(T), T =
end_of_file, !, wait(P,S).

or

exec('c:/cygwin/bin/echo abc', I,O,E,P), repeat, get_char(O,T),
write(T), T = end_of_file, !, wait(P,S).

What do you obtain ?

If you want a pure cygwin app you should download a source .tar.gz
package and build it under cygwin.

Daniel

Le 12/12/2011 21:22, Mark Utting a écrit :

I'm trying to upgrade to Gprolog 1.4, but my exec
calls to a theorem prover have stopped working.

In fact, every exec/5 call seems not to work, and causes wait/2 to
throw an error as the following 2 examples show:

===================================================

$ gprolog

GNU Prolog 1.4.0

By Daniel Diaz

Copyright (C) 1999-2011 Daniel Diaz

| ?- exec('bash query_Simplify.sh simplifyFile.smp', A, B, C,
PID).

A = '$stream'(3)

B = '$stream'(4)

C = '$stream'(5)

PID = 5972

yes

| ?- wait(5972, Status).

uncaught exception: error(system_error('No child
processes'),wait/2)

# even /bin/echo gives the same error

| ?- exec('/bin/echo abc', A,B,C,D).

A = '$stream'(9)

B = '$stream'(10)

C = '$stream'(11)

D = 7564

yes

| ?- wait(7564).

uncaught exception:
error(existence_error(procedure,wait/1),top_level/0)

| ?- wait(7564, Status).

uncaught exception: error(system_error('No child
processes'),wait/2)

| ?- exec('/bin/echo', A,B,C,D).

A = '$stream'(12)

B = '$stream'(13)

C = '$stream'(14)

D = 4900

yes

| ?- wait(4900, Status).

uncaught exception: error(system_error('No child
processes'),wait/2)

| ?-

=======================================================

The above exec of 'bash query_Simplify.sh simplifyFile.smp' worked
fine with Gprolog 1.3.

(and that command works from the command line).

Any suggestions how I can work around this problem?

I'm using the binary 64-bit Windows version of GProlog 1.4.0:

Windows
intel 64 bits auto-install setup (compiled under x86_64 /
Windows 7 with MinGW64 gcc under Cygwin).

This is under Windows 7 64-bit with an up-to-date Cygwin, and
Mingw 64-bit gcc installed (the gprolog and gplc commands work
fine).

$ uname -a

CYGWIN_NT-6.1-WOW64 RWS034 1.7.9(0.237/5/3) 2011-03-29 10:10 i686
Cygwin

Thanks!

Mark

--

Ce message a été vérifié par
MailScanner
pour des virus ou des polluriels et rien de
suspect n'a été trouvé.

_______________________________________________
Bug-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-prolog

--

Ce message a été vérifié par
MailScanner
pour des virus ou des polluriels et rien de
suspect n'a été trouvé.

_______________________________________________
Bug-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-prolog