Mail Archives: djgpp-workers/2000/10/29/01:19:24
On Sat, 28 Oct 2000, Peter J. Farley III wrote:
> At 09:25 AM 10/28/00 +0200, Eli Zaretskii wrote:
> <Snipped>
> >Note that popen/pclose from our libc also redirect handles with
> >dup/dup2 and call system() to run the subsidiary program.
>
> I guess Laszlo put those in before the current popen/pclose were
> available.
I doubt that: our popen/pclose is mostly unchanged from what was released
with v2.0.
> Better, I think, if we try to use what's in libc, so that
> future changes aren't lost to perl. I'll try removing his
> perl-specific versions and make sure everything still works.
I'd suggest to as Laszlo first, in cased there's a good reason for what
he did.
> If it turns out we need to use "exec("sh -c 'command...'")" or
> "spawn...("sh -c 'command...'")" to duplicate *ix behavior, then I can
> put the special versions into perl only, leaving libc alone.
The only difference between the above and what libc does now is the -c
switch. If that's the important difference, you could always say
popen("sh -c 'command...'", ...) instead of just popen("command", ...).
Note that by forcing "sh" into popen you force Perl users to install
Bash, even if the commands they use don't require Bash. I don't know
whether this is a problem.
> Is there any way (at present) to override system()'s use of "bash
> tmpfile" or "sh tmpfile", say if the command line is short enough to
> stay within DOS commandline limits?
Before you embark on that journey, let's be sure this is what causes the
different behavior. There are good reasons for the way `system' calls a
Unixy shell (I forget the details, but the comments there say something
about here-documents).
> What about just for power users
> who have set up CONFIG.SYS to use the "command.com" switch
> "/u:255"? I'd bet there is a way to determine if that was done
> *somewhere* in the DOS internals.
Don't bet: you'd lose ;-).
> I still have not determined just exactly how
> perl implements open(fh, "echo #foo|"), so we are still lacking
> critical information needed to determine a path to take.
Yes.
- Raw text -