On Mon, Jul 30, 2001 at 06:16:10PM +0100, Christophe Rhodes wrote:
> There is an infelicity in sbcl's handling of *d-p-d*, or rather in its
> interaction with the SB-UNIX package and various extensions.
> I'd like to run an external program with a particular current working
> directory, and I can't see a way of doing this within the lisp world;
> I can change *d-p-d*'s value, which means that the lisp world behaves
> as though the current directory were the directory of *d-p-d*, but
> run-program doesn't respect this; and there doesn't seem currently to
> be a way, short of an explicit alien-funcall "chdir", to make the
> required change to the lisp environment.
> Is this intended behaviour? Is there a `nice' way of fixing this if
It looks to me as though the distinction between the Lisp-level
behavior and the Unix-level behavior is pretty much required by the
standard. I don't see any clean, unsurprising way to make the
Unix-level default directory change automatically with
It might make sense to define some new functions and macros exported
alongside RUN-PROGRAM (and perhap add new behavior to old functions,
too) to help people to deal with the problem more conveniently.
Perhaps something like
(DEFUN UNIX-CHDIR (&OPTIONAL (NEW-DIRECTORY ..)) ..)
(DEFUN WITH-UNIX-CHDIR ((&OPTIONAL NEW-DIRECTORY) &BODY BODY) ..)
where the default is taken from *DEFAULT-PATHNAME-DEFAULTS*
(WITH-UNIX-CHDIR () (RUN-PROGRAM ..))
would, I think, do what you want.
It would be possible to have RUN-PROGRAM do WITH-UNIX-CHDIR
automatically by default, but that's more complicated than what we do
now, and seems at least as surprising as what we do now, so I doubt
it's a good idea.
William Harold Newman <william.newman@...>
PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C