[Haskell] Win32 process spawning, POpen and Hugs, revisited

Graham Klyne gk at ninebynine.org
Wed Mar 17 17:30:36 EST 2004


At 11:43 17/03/04 +0000, Ross Paterson wrote:
>On Wed, Mar 17, 2004 at 10:47:59AM +0000, Graham Klyne wrote:
> > So this (alone) is not enough.  I did also try using "a" and "ab", but no
> > joy there, either.  This starts to point to some interaction between the
> > I/O library and Windows anonymous pipe.  My C code (which works as
> > expected) uses the _write function (equiv. Unix "write") directly on the
> > returned file descriptor.
>
>Can you try fdopen+fwrite in your C code?

Ah, yes....

All relevant source code is here:
http://www.ninebynine.org/Software/HaskellUtils/Win32/

The revised calling program is here:
http://www.ninebynine.org/Software/HaskellUtils/Win32/FdSpawnEchoShiftLetters.c

The result from running the revised code is this:
[[
D:\Dev\HaskellUtils\Win32>FdSpawnEchoShiftLetters
Characters written: 26
Characters read from sout: 26
Data: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
Characters read from serr: 43
Data: 'EchoShiftLetters: 26 characters processed.
'
FdSpawnEchoShiftLetters: finished.

D:\Dev\HaskellUtils\Win32>
]]

That is, it works fine.  I tried this using "w" and "w+" access 
modes.  Both worked OK.

#g


------------
Graham Klyne
For email:
http://www.ninebynine.org/#Contact



More information about the Cvs-hugs mailing list