pymad / cpymad

cPyMAD is a python interface to Mad-X using cython and libmadx
http://cern.ch/pymad
Apache License 2.0
3 stars 3 forks source link

Add function to change directory in the remote process #51

Closed coldfix closed 10 years ago

coldfix commented 10 years ago

When executing MAD-X commands that depend on the filesystem, it is useful to be able to control the directory that is used by the remote MAD-X instance.

This becomes especially important when trying to madx.call() files containing CALL statements with relative pathes. I believe, the user expectation is that these should work, which is why I modified the madx.call() method to temporarily change the directory by default.

See also, this related issue in madgui.

Eothred commented 10 years ago

Hi, Did not look at the source changes for this issue yet. Just wanted to point out that often the files that are called by Mad-X are stored on read-only server systems (namely afs for CERN people). Hence, if you change directory to where the file is located before calling it, the file will typically not work as they set up soft links (so expect the folder you are currently in is writeable). The default action should not be to change to the location of the file in my opinion but to stay put.

coldfix commented 10 years ago

Okay, sure, we can change that back.