Suggestion for std.process upgrade

Bane branimir.milosavljevic at gmail.com
Mon Dec 12 14:08:53 PST 2011


I have been playing with std.process (D2) lately, and have 2 suggestions 
and more or less tested code if somebody other than my self have use for it.

One is shell() function (not mentioned in the docs, curious), I see it 
can be made more efficient on Windows. It executes shell command and 
returns standard output as string. Current implementation do it by 
piping stdout to temporary file on disk and reading that file back. 
Using CreateProccess Windows API it can do same job 3 times faster and 
remove need for temporary files and disk writes. I think that is 
beneficial gain for some applications.

Other is fork-exec implementation eg. starting a program using command 
line and detaching it from parent, so it continues to run after parent 
is dead. On Posix it is implemented using fork() and exec() calls, on 
Windows using CreateProcess.

One question. Is std.c.windows.windows lacking for most API definitions 
or am I looking on wrong place?



More information about the Digitalmars-d mailing list