On Mon, 13 Oct 2003, Lars Gullik Bjønnes wrote:
> | It relies only in permission bits. That is, it tries all lyx_tmpdir..., > | and stays with the first it can connect. Of course it cannot connet to a > | socket that is under a closed directory. The socket itself is created > | closed for other users. > > Will it then continue the search? (or is that how it searches?) > (I know I could just look at the code...) It will look for all directories of the form lyx_tmpdir* in /tmp and try to stat a file called lyxsocket inside each of them. If it can stat, then it will try to connect to it. Fail means that the socket is dead, that is, there is no server listening to that address. If all possible lyx_tmpdir* were tried and none could provide a connection, then the client will fail with an error message. A bash pseudo code for it: for dir in /tmp/lyx_tmpdir*; do if stat $dir/lyxsocket && connect $dir/lyxsocket; then client stuff exit 0 fi done echo "Could not find a suitable server" exit 1 João.