Is there a way to define in the scripting host the...
# scripting
e
Is there a way to define in the scripting host the working directory of the script evaluation? I currently write a scripting host, which should run continuously and it gets the script file path via a socket. So when I execute the script file it runs in the working directory of the scripting host, but I want to execute it in its own directory. I tried to find a setting for the
ScriptEvaluationConfiguration
but couldn't find anything.
i
There is no specific functionality for setting the working directory, but you can try to use, e.g., the
scriptExecutionWrapper
property of the evaluation configuration, to configure it. But please be aware, that there are some problems with setting working dir in JVM, see e.g. https://stackoverflow.com/questions/840190/changing-the-current-working-directory-in-java
(Note that there is no new process created, then the script is executed by the default
BasicJvmScriptEvaluator
.)