Paul L wrote:Did you verify that this works for you in Linux? As for the ~, that is the environment variable $HOME, correct? If XLisp gives you getenv, then doing the rest in Lisp should be easy enough.
On 'Nix systems, "~/" (
tilde, forward-slash) refers to the user home directory.
This is usually something like:
/home/<user-name>/
The first "/" is the root directory. There is nothing below the root directory, that is the start of the file system.
This is the environment variable $HOME (upper case).
In Bash shell:
in Nyquist:
Code: Select all
(get-env "HOME")
; returns /home/john-doe
It would probably be best for the "include" function to return "nil" on fail, then for Linux the user code can have something like:
Code: Select all
(if (not (include "plug-ins" "hello.lsp"))
(load (format nil "~a/.audacity-files/plug-ins/hello.lsp"
(get-env "HOME"))))
or something like that could be in the "include" function.
Also, Nyquist has a global: *file-separator* which returns the file separator character "" if on Windows or "/" if on 'Nix.