Returns a string containing the full path to the file in which the statement is contained.
__FILE_DIRis only available for use inside a program file. It cannot be used at the GAUSS command prompt.
A common use of
__FILE_DIRis to locate a data file which is in the same directory as the code file, but may not be the current working directory. For example, the GAUSS example file
gmmfitiv_auto.eis located in the GAUSS examples directory. This example code needs to load a dataset which is also located in the GAUSS examples directory. For this purpose, it uses the line:
// Create fully pathed dataset file name string auto_dset = __FILE_DIR $+ "auto.dat";
This code will set the string “auto.dat” equal to the full path to the GAUSS examples directory followed by “auto.dat”, regardless of your system or installation directory. The actual contents of this string will vary depending on your system, but will look similar to this:
// Mac "/Users/YourUserName/gauss/examples/auto.dat" // Windows "C:\\gauss\\examples\\auto.dat" // Linux "/home/yourusername/gauss/exmples/auto.dat
__FILE_DIRis technically a GAUSS define, therefore it cannot be appended with parentheses like this:
// Adding parentheses to the end is incorrect __FILE_DIR();