Closed esc-mhild closed 3 years ago
Short answer is no, for a good reason. The ID has no meaning for the client, is has no semantic meaning and its existence should not be assumed by the client, it is only of historical interest and is not used by more modern deployments which typically switch to more random locations.
I assume the reason you ask is that you care about the working directory of the session and as you pointed out that is trivially obtainable (that is not a work-around, that is the proper way).
The server assigns a numeric ID to the client connection and constructs the connection's PWD from it (e.g,
/tmp/Rserv/conn4711
).Can this ID be accessed efficiently by, say, a Java RConnection client?
Use case: This ID could be logged by the client to correlate client events with the directory created by the server for the connection - a potentially useful feature during debugging.
As a workaround, one can
c.eval("getwd()")
and parse the returned string.