I'm calling a CL script from various places in the system. How do I get the file path of the script that is currently executed?
For example, the script source file is located in the /home/user/project/source/
directory. The script is being executed from the /home/user/
directory in the following manner:
user@machine:~$ ./project/source/script.lsp
Regardless of the callers location, script should know that it's located in the /home/user/project/source/
directory.
I've tried using the *default-pathname-defaults*
variable, but the following command shows the directory from which the script was called:
(format t "Pathname: ~S~&" *default-pathname-defaults*)
Environment: SBCL 1.4.5.debian on Ubuntu 18.04.