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

**URL:** https://discourse.paraview.org/t/how-to-find-the-remote-directory-in-which-pvserver-command-is-executed/9386
**Category:** ParaView Support
**Created:** [April 7, 2022, 9:53am UTC](https://discourse.paraview.org/t/how-to-find-the-remote-directory-in-which-pvserver-command-is-executed/9386 "2022-04-07T09:53:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![gv871](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/46a35a/32.png) [@gv871](https://discourse.paraview.org/u/gv871)
#### Post date: [April 7, 2022, 9:53am UTC](https://discourse.paraview.org/t/how-to-find-the-remote-directory-in-which-pvserver-command-is-executed/9386/1 "2022-04-07T09:53:44Z")

</div>

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

> [@How to access to pvserver files from Python shell](https://discourse.paraview.org/t/how-to-access-to-pvserver-files-from-python-shell/2573):
>
> In my server machine I am running pvserver: mpiexec -np 12 pvserver On my local machine I could easily connect to the server machine and from File \> Open I could browse files on the server but when I run Python Shell (View \> Python Shell) I don’t know how to access the remote files: import os os.getcwd() # This returns the path in the local machine not in the remote server. How can I access remote server files from within Python Shell in the local machine?

but I got nowhere.  
If I execute the following

```auto
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.

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [April 7, 2022, 3:33pm UTC](https://discourse.paraview.org/t/how-to-find-the-remote-directory-in-which-pvserver-command-is-executed/9386/2 "2022-04-07T15:33:44Z")

</div>

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](https://github.com/Kitware/ParaView/blob/master/Web/Python/paraview/web/protocols.py#L3747-L3748). I’m not sure if a special string could be used to evaluate the user home like `$HOME`?

---

<div class="post-metadata">

### Author: ![gv871](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/46a35a/32.png) [@gv871](https://discourse.paraview.org/u/gv871)
#### Post date: [April 8, 2022, 7:30am UTC](https://discourse.paraview.org/t/how-to-find-the-remote-directory-in-which-pvserver-command-is-executed/9386/3 "2022-04-08T07:30:59Z")

</div>

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

```auto
 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?

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [April 8, 2022, 3:56pm UTC](https://discourse.paraview.org/t/how-to-find-the-remote-directory-in-which-pvserver-command-is-executed/9386/4 "2022-04-08T15:56:23Z")

</div>

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.
