From jan@swi.psy.uva.nl Wed Jun  6 20:20:15 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f56IKF307605;
	Wed, 6 Jun 2001 20:20:15 +0200 (MET DST)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f56IKFi31964;
	Wed, 6 Jun 2001 20:20:15 +0200
Date: Wed, 6 Jun 2001 20:20:15 +0200
Message-Id: <200106061820.f56IKFi31964@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: [SWIPL] SWI-Prolog 4.0.6 problem on Solaris 2.6
To: Vincent Manuel Barrilliot <vbarr@cme.nist.gov>, prolog@swi.psy.uva.nl
In-Reply-To: Vincent Manuel Barrilliot's message of Wed, 6 Jun 2001 11:56:47 -0400 (EDT)
Phone: +31 - 20 - 525 6121

> BING !!
> PART_SLOT.pl is on NFS, and it looks like the handle is stale. But I don't understand why. I genera> te this file 
> from C code, then fclose() it (successfully, I've checked that), then send a notification (via sock> et) to the Java 
> agent so that it starts a Prolog engine and consult() it.
> 
> What I didn't tell you is that the C code generating the PART_SLOT.pl is running on a remote comput> er (with a lot 
> of memory to run Pro/ENGINEER) while the Java agent is running on my computer.
> I had a look on the net and figured out that maybe when a computer changes a file on a NFS it creat> es a new handle 
> for it, making invalid those used by other computers and which may not be up to date. (they should > be updated 
> automatically, don't they ??).
> I have tried to run both of the wrapping agent and Pro/E on my machine so that there is no problem > of NFS handle, 
> and it works !!!

Without going into details, the idea of writing a file onto a shared
filesystem and reading it from another machine isn't a very good idea
for exchanging data between client and server.

If you have to make data available to your client do so using sockets.
It is debatable what (and whether you should use a) protocol to use
on top of TCP/IP.  If you're exchanging as Prolog source anyhow,
simply use the library(socket) to connect to the server and read
the Prolog terms.  It is quite easy!

> > system level and what errors are returned.  Finally, is it just this
> > file, any file on this file-system, in this directory or just any file?
> 
> Your guess put me on the track, and thank you for telling me about truss, I think this thing is gon> na be my life 
> saver in the future !

truss (strace on Linux, trace on some other Unix systems) is a live-saver,
especially to monitor file-system access.

> Thank you very much Jan ! :-)

:-)

	--- Jan

