Open hllizi opened 11 months ago
Using with-cwd somehow messes up the way the interpreter looks for the file to be executed if the interpreter is started via a shebang sequence and with-cwd is employed in a file that is loaded with "-l" or "-lm". (I am using Scheme 48, btw)
Minimal (non)working example:
lib.scm:
lib.scm
(with-cwd "/tmp" (for-each display (directory-files)))
main.scm:
main.scm
#! /nix/store/3x6dm1pp2m2pb104agz0r8fzcms13wam-scsh-0.7pre/bin/scsh \ -l lib.scm -s !# (display "I got here!")
The result when both files are put in the same directory and main.scm ist executed is:
error: No such file or directory [open-input-file] "./main.scm" #{&i/o-error}
A hackish solution to the problem is to put (chdir ".") at the end of lib.scm. Then "I got here!" will get to be printed.
(chdir ".")
The same problem exists when Scheme 48 modules are used and with-cmd is used in the definitions.
with-cmd
Using with-cwd somehow messes up the way the interpreter looks for the file to be executed if the interpreter is started via a shebang sequence and with-cwd is employed in a file that is loaded with "-l" or "-lm". (I am using Scheme 48, btw)
Minimal (non)working example:
lib.scm
:main.scm
:The result when both files are put in the same directory and
main.scm
ist executed is:A hackish solution to the problem is to put
(chdir ".")
at the end oflib.scm
. Then "I got here!" will get to be printed.The same problem exists when Scheme 48 modules are used and
with-cmd
is used in the definitions.