# open auxiliary text file in client-server mode on the server?

**URL:** https://discourse.paraview.org/t/open-auxiliary-text-file-in-client-server-mode-on-the-server/10968
**Category:** ParaView Support
**Tags:** python
**Created:** [December 13, 2022, 6:31pm UTC](https://discourse.paraview.org/t/open-auxiliary-text-file-in-client-server-mode-on-the-server/10968 "2022-12-13T18:31:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Noerr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/noerr/32/10562_2.png) [@Noerr](https://discourse.paraview.org/u/Noerr)
#### Post date: [December 13, 2022, 6:31pm UTC](https://discourse.paraview.org/t/open-auxiliary-text-file-in-client-server-mode-on-the-server/10968/1 "2022-12-13T18:31:23Z")

</div>

Hi, I’m working with XDMF datasets with Paraview 5.11 often in client-server model. The visualization pipeline is scripted using the Python API including a Programmable Filter that evaluates several output variables based on calculations involving scalar values stored in simulation\_constants.txt along side the .xdmf file.

Things work well when in the client-only mode where datasets are on my local workstation.  
In client server-mode, the filename provided to `simple.XDMFReader` loads a file from the server-side filesystem, while filenames provided to Python’s `open(".../simulation_constants.txt")` are referencing the client-side filesystem.

I understand the distinction and the behavior is basically consistent with how sys.path and Python import commands are referencing the local client filesystem too.

How can I load a remote text file and do simple readline() type operations?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 14, 2022, 7:31am UTC](https://discourse.paraview.org/t/open-auxiliary-text-file-in-client-server-mode-on-the-server/10968/2 "2022-12-14T07:31:56Z")

</div>

Hi @Noerr ,

> [@Noerr](#):
>
> In client server-mode, the filename provided to `simple.XDMFReader` loads a file from the server-side filesystem,

This is expected. The programmable filter code will always be executed server side, where the data is supposed to be.

> while filenames provided to Python’s `open(".../simulation_constants.txt")` are referencing the client-side filesystem.

Where do you write this code ? In the programmable filter, it will be server side too.

> How can I load a remote text file and do simple readline() type operations?

In a prog filter.

---

<div class="post-metadata">

### Author: ![Noerr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/noerr/32/10562_2.png) [@Noerr](https://discourse.paraview.org/u/Noerr)
#### Post date: [December 14, 2022, 3:03pm UTC](https://discourse.paraview.org/t/open-auxiliary-text-file-in-client-server-mode-on-the-server/10968/3 "2022-12-14T15:03:34Z")

</div>

Oh thanks for that idea. It sounds encouraging as a solution.

This approach didn’t come intuitively for a couple of reasons. It seems odd to add IO type code on the Programmable Filter. I’ll also have to duplicate my Python post processing modules on both client and server side. There are a couple dozen scalar parameters i’m trying to bring in. I suppose the import parameters calls will have to be repeated anywhere I reuse them.

I can also anticipate I’ll want to eventually do things like scale colorbar ranges or camera controls based on the same parameters. These scalar parameters would need to be known on client-side too. :-/

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 16, 2022, 12:57pm UTC](https://discourse.paraview.org/t/open-auxiliary-text-file-in-client-server-mode-on-the-server/10968/4 "2022-12-16T12:57:53Z")

</div>

> [@Noerr](#):
>
> It seems odd to add IO type code on the Programmable Filter.

That is the ParaView way

> I’ll also have to duplicate my Python post processing modules on both client and server side.

In ParaView world, data processing is always server side.

> I can also anticipate I’ll want to eventually do things like scale colorbar ranges or camera controls based on the same parameters. These scalar parameters would need to be known on client-side too. :-/

You can control that from client side without issue, but you do not need the whole data to find the right parameters.
