how to find the remote directory in which pvserver command is executed ?

Hello,
I would like to use the remote directory where the pvserver command is executed.
I tried to follow the suggestion in this answer

but I got nowhere.
If I execute the following

pxm = paraview.servermanager.ProxyManager()
directory_proxy = pxm.NewProxy('misc', 'ListDirectory')
fileList = paraview.servermanager.VectorProperty(directory_proxy,directory_proxy.GetProperty('FileList'))
directoryList = paraview.servermanager.VectorProperty(directory_proxy,directory_proxy.GetProperty('DirectoryList'))
print(directoryList)

the code print a None.

While I would like to have somethig like: /home/user

Thank you for any suggestion you can give me.

Those are meant to list content of a directory on the server side. You need to provide the path to check on the server. That’s why you are getting None. The path to check is invalid.

You need to feed that information to that proxy. I’m not sure if a special string could be used to evaluate the user home like $HOME?

Thanks for the answer. If I try to use a system variable

 os.environ.get('HOME')

it will always use the variable in the local system. is there any other solution to let python script where on the server it is executed?

I don’t know on top of my head. That’s why I mentioned string for doing something like

directory_proxy.List("$HOME/some/sub/path") as that string would be evaluated on the server side and not on the client.