# `yt_run_ReloadScript` -- Reload Script ## `yt_run_ReloadScript` ```cpp int yt_run_ReloadScript(const char* flag_file_name, const char* reload_file_name, const char* script_name); ``` - Usage: Start [Reloading Script](../in-situ-python-analysis/reloading-script.md#reloading-script) phase when `` file is detected, or an error occurred when running inline functions. `libyt` starts reloading the script `` if `` file is detected, and it exits the API if `_EXIT` file is detected. Outputs will be printed in `_SUCCESS` or `_FAILED`. - Return: - `YT_SUCCESS` - `YT_FAIL`: When `libyt` is not compiled with `-DINTERACTIVE_MODE`, it returns `YT_FAIL`. > {octicon}`info;1em;sd-text-info;` Must compile `libyt` with [`-DINTERACTIVE_MODE=ON`](../how-to-install/details.md#-dinteractive_mode-off). ## Example The code will stop and enter reloading script phase, if `LIBYT_STOP` is detected or an inline function failed. It will reload `test_reload.py` when `RELOAD` file is detected, and it will exit the API once `RELOAD_EXIT` is detected. Output results will be printed in `RELOAD_SUCCESS` or `RELOAD_FAILED`. See [Reloading Script](../in-situ-python-analysis/reloading-script.md#reloading-script) for details. ```cpp #include "libyt.h" ... if (yt_run_ReloadScript("LIBYT_STOP", "RELOAD", "test_reload.py") != YT_SUCCESS) { fprintf(stderr, "ERROR: yt_run_ReloadScript failed!\n"); exit(EXIT_FAILURE); } ```