KProcess overhaul [PATCH]
ossi at kde.org
Mon Apr 17 13:57:13 BST 2006
On Mon, Apr 17, 2006 at 01:57:25PM +0200, Ralf Habacker wrote:
> 8-10 not implemented (on windows not required)
this is simply not true. only pty support is not needed; redirections in
general *are* needed, now even more than before, as we want portability,
so we can't simply use the unix shell syntax anymore.
> new use cases
> 11. run a process using a command line shell
it should be noted that this bears *considerable* portability problems.
the quoting rules are *totally* different and cmd.exe is slightly limited
in its possibilities.
the only thing the shell should be used for are user-supplied commands.
for internal stuff, either the code should be rewritten not to use a
shell (as stated before, the majority of the cases is a poor man's
workaround for the lack of redirection support in kprocess), or, if it
is not hard-coded (like in .desktop files), it should be written in unix
shell syntax and interpreted internally - i intend to put a *simple*
shell execution semantics interpreter into KShell.
> Any comments or objectivities ?
it's objections. ;)
yes, i have some.
1) on unix, -c is required (where it is /c on windoze). remember that
everything in windows that is not fundametally new (is there something
like that at all?) is based on unix concepts. :-P
btw, you botched the if-else cascade. but there's no reason for
shellOptions anyway, as it is required to be consistent among shells.
2) you botched the command composition. it is
"shell -c <all-arguments-concatenated>", not "shell -c <arg> <arg> ...".
on windows that does not matter, as everything is more or less simply
concatenated into one string anyway, but on unix it does.
3) you leak the d pointer
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
Chaos, panic, and disorder - my work here is done.
More information about the kde-core-devel