[xcvb-devel] run-program unit test failures

Faré fahree at gmail.com
Tue Apr 26 18:17:11 UTC 2011


> What is the intended usage of run-program/process-output-stream?
>
If the command given to run-program/* is a list,
then it directly encodes the values for executed program's argv,
as passed to execve or spawn or equivalent.

If it's a string, then it's a command passed to the shell
or command interpreter, as in "/bin/sh" "-c" "command..."
or (under Windows) "CMD /C command...".

> What kind of arguments do you give it and how do they relate to your
> argument escape codes? Suppose unix, would these be valid programs:
>
> '("cp" "foo" "bar")
> '("echo" "foo bar")
Should work fine.

> '("cat" "/etc/passwd" "|" "grep" "root")
Won't work, unless you have files named "|" grep and root.
Maybe you want
"cat /etc/passwd | grep root" which will be passed to the interpreter.

> '("cat /etc/passwd | grep root")
Even worse. Lose the list.

> What if I had a file named '|'?
>
> '("cat" "|") ;; doesn't work.
>
Yes it should.

> how do I escape that? Must I write the escape by hand?
>
> '("cat" "\|") ;; Like this?
>
Should be the same.


> So far, I think I've found some bad edge cases with
> run-program/process-output-stream concerning special shell
> characters. But, I need to know what you intend before reporting (or
> fixing) the bugs or not.
>
I think it's working fine, at least under SBCL.
Definitely requires more documentation, though.

Test cases also make for great documentation.

[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ]
The early bird gets the worm, but the second mouse gets the cheese.
	— Stephen Pinker




More information about the xcvb-devel mailing list