The new std.process is ready for review
Steven Schveighoffer
schveiguy at yahoo.com
Sun Feb 24 16:02:54 PST 2013
On Sun, 24 Feb 2013 18:52:04 -0500, Vladimir Panteleev
<vladimir at thecybershadow.net> wrote:
> On Sunday, 24 February 2013 at 22:13:35 UTC, Steven Schveighoffer wrote:
>> On Sun, 24 Feb 2013 16:04:43 -0500, Vladimir Panteleev
>> <vladimir at thecybershadow.net> wrote:
>>
>>> On Sunday, 24 February 2013 at 17:41:44 UTC, Lars T. Kyllingstad wrote:
>>>> Ok, a new version with non-blocking wait is up.
>>>
>>> 3. The documentation for the "gui" config item seems to be wrong: it
>>> prevents the creation of a console, instead of causing it.
>>
>> It means 'use gui mode' which means, don't create a console. I don't
>> consider a console window a gui.
>
> Sorry, I think you misunderstood.
>
> Currently, the documentation says:
>
> "On Windows, this option causes the process to run in a console window."
>
> However, when the flag is PRESENT, then the console window is SUPPRESSED
> (see line 522). The documentation's meaning is reversed.
Yes, you are right. It needs to be fixed. Thanks.
>
>> No, snn.lib included with the compilers for a few versions has been
>> patched. The exeception you would get would be different, that appears
>> to be coming from std.process, even though the file name seems to be
>> std.stdio.
>
> OK... then I guess it doesn't work for me. Does it work for anyone else
> on Windows?
>
> Full code of my ls test program:
>
> import std.stdio;
> import std.process2;
>
> void main()
> {
> string[] files;
> auto p = pipe();
>
> auto pid = spawnProcess("ls", stdin, p.writeEnd);
> scope(exit) wait(pid);
>
> foreach (f; p.readEnd.byLine()) files ~= f.idup;
> }
Hm... that message is printed out if the code cannot set the inherit
handle flag on the specific stdin.
Are you on windows 64 or 32? It's a large difference since one uses
MSVCRT and one uses DMCRT. Also, I don't have windows 64, so I can't
verify this if that's the case :)
-Steve
More information about the Digitalmars-d
mailing list