develooper Front page | perl.perl5.porters | Postings from April 2019

[perl #134046] perlport - Open modes -| and |- now supported inWin32

Thread Previous
Tony Cook via RT
April 24, 2019 01:35
[perl #134046] perlport - Open modes -| and |- now supported inWin32
Message ID:
On Thu, 18 Apr 2019 15:47:06 -0700, wrote:
> Pipe open modes in the list form of open() have been supported in Win32
> since Perl 5.22. Thus the "Win32" designation should be removed from the
> note in the section for open in perlport. It doesn't appear that any of the
> other function notes reference limitations in past versions of Perl.
> I am unsure if an additional note should be added for Win32, as the Perl
> 5.22 perldelta says "It has the same limitations as system LIST on Win32,
> since the Win32 API doesn't accept program arguments as a list." but also
> "Note: unlike system LIST this does not fall back to the shell." which
> contradicts the only limitation I could find of system LIST on Win32, that
> it may fall back to the shell.

Perhaps I should have expanded on that.

The common limitation with list system and list pipe open on Win32 is that they depend on the child process parsing the supplied command-line in a particular way, ie. the same way as the VC++ runtime (and presumably as CommandLineToArgvW ()), but there's no requirement that the child process does so.

There's also one very important child process that doesn't parse the command-line that way - the shell.

On POSIX systems the low-level API that creates a process accepts an array of arguments which are then passed to the child process with no parsing involved.

The limitation specific to list pipe open is it never falls back to the shell, since the shell uses it's own escaping mechanism for the command-line.

See for why it's a problem.


via perlbug:  queue: perl5 status: new

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About