SRC_PATH is a list of paths which GAUSS uses to search for files. For example, if you enter:
at the GAUSS command prompt, or you have a file which contains the line:
GAUSS will first look in your current working directory for
myprocs.src. If they are not found, GAUSS will then search the folders in the
How can I find my current SRC_PATH?
View in Library Tool
You can see which folders are in your
SRC_PATH in the Library Tool by following these steps.
- Open the Library Tool (View > Library Tool).
- Expand the Paths node and the Sources node.
The last two folders from the full path are shown. Hover your mouse over one of the paths to see all folders in the path.
Alternatively, you can use the
sysstate command to print out a semi-colon separated list of paths.
// Print the SRC_PATH folders print sysstate(22,0);
The above command will return something similar to one of the following.
C:\gauss\src;C:\gauss\examples /Users/YourUserName/gauss/src;/Users/YourUserName/gauss/examples /home/user/gauss/src;/home/user/gauss/examples
How can I modify my SRC_PATH
Change the SRC_PATH with the sysstate command
You can also use the
sysstate command to modify your
SRC_PATH. Instead of passing in a zero for the second argument, pass in the new
// Get the current SRC_PATH old_src_path = sysstate(22, 0); // Add a new path to the front of the SRC_PATH new_src_path = "C:\gauss\myproject\src;" $+ old_src_path; // Set the new SRC_PATH call sysstate(22, new_src_path); // Print the SRC_PATH to confirm the change print sysstate(22,0);
SRC_PATH folders are searched in order, adding a new path to the front of the list means that it will be searched first (after the current working directory). This new
SRC_PATH will be in effect until it is reset or until GAUSS is restarted.
Change the SRC_PATH in gauss.cfg
When GAUSS starts up, the
SRC_PATH is initially set from the contents of the
gauss.cfg file. The
gauss.cfg file is located in the GAUSSHOME directory. The line which controls the
SRC_PATH will look something like this.
# multiple paths for program files src_path = $(GAUSSDIR)/src;$(GAUSSDIR)/examples;$(GAUSSDIR)/gaussplot/src;$(GAUSSDIR)/gaussplot/examples;$(PACKAGEDIR)/*/src;$(PACKAGEDIR)/*/examples
In the line above,
$(GAUSSDIR) means your GAUSSHOME directory. In the code below, we add the same path from our earlier
sysstate example to the front of the
# multiple paths for program files src_path = C:\gauss\myproject\src;$(GAUSSDIR)/src;$(GAUSSDIR)/examples;$(GAUSSDIR)/gaussplot/src;$(GAUSSDIR)/gaussplot/examples;$(PACKAGEDIR)/*/src;$(PACKAGEDIR)/*/examples
Since this file is read every time that GAUSS starts, this is a more permanent solution.
We have seen that:
SRC_PATHis a list of file paths that GAUSS searches when looking for files to run or open.
- The current
SRC_PATHcan be found by looking in the Library Tool, or using the
SRC_PATHcan be modified with the
sysstatecommand or by editing the