From jan@swi.psy.uva.nl Tue Dec 11 13:33:00 2001
Received: from gollem.swi.psy.uva.nl (root@gollem.swi.psy.uva.nl [145.18.152.30])
	by swi.psy.uva.nl (8.11.6/8.11.2) with ESMTP id fBBCX0506453;
	Tue, 11 Dec 2001 13:33:00 +0100 (MET)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id fBBCWxN06823;
	Tue, 11 Dec 2001 13:32:59 +0100
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: "Ioannis Partsakoulakis" <jpar@aegean.gr>, <prolog@swi.psy.uva.nl>
Subject: Re: [SWIPL] loading foreign files
Date: Tue, 11 Dec 2001 13:26:16 +0100
X-Mailer: KMail [version 1.0.29.2]
Content-Type: text/plain
References: <PIEMJIMCPILKJIDGLNEIIEHACAAA.jpar@aegean.gr>
In-Reply-To: <PIEMJIMCPILKJIDGLNEIIEHACAAA.jpar@aegean.gr>
MIME-Version: 1.0
Message-Id: <01121113325904.20586@gollem>
Content-Transfer-Encoding: 8bit

On Tue, 11 Dec 2001, Ioannis Partsakoulakis wrote:
>There is a predicate start/2 that loads another file that is specified by
>the user:
>
>start(InputFile,Message):-
>    consult(InputFile),
>    ...
>
>The file containing the start predicate definition is contained in a qlf
>file and that qlf file is loaded into memeory with PL_initialize in a C++
>application. When I call start with PLQuery the application cannot find the
>file specified (ex. source_sink 'test.pl' does not exist) although I know
>its there.

Little clue.  Maybe the working directory is different between the two
setups?  If the application can access a terminal/console, try adding
a call to trace/0 in the program to allow you debugging:

start(InputFile, Message) :-
	trace,
	consult(InputFile_,
	...

Use `b' (break) to enter the toplevel, check the environment using pwd/0
and/or ls/0.  If we are talking Unix try to run the program under the
system call-tracer (strace on Linux, truss on Solaris, check manual on
others) to see what files it is trying to open where.

>Prolog runs with no problem the start predicate when not embedded in the C++
>application.
>
>PLQuery does fine when I am not trying to load some file in that way.
>
>If I consult the InputFile with :-consult('test.pl') then the file is loaded
>withing the qlf file. However I want to change the InputFile and the program
>to change behavior.

What does it mean to load a file within a qlf file??

	--- Jan

