Subject: Re: [SWIPL] SWI-Prolog 4.0.6 problem on Solaris 2.6

From: Jan Wielemaker <[email-masked]>
Date: Wed, 6 Jun 2001 20:20:15 +0200

> 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