Eli Zaretskii wrote: >>+ stream = fdopen (fd, "r"); > > ^^^ > Shouldn't this be FOPEN_RT, like what was used in the call to fopen in > the original code? Quite so. I don't know where that came from. Update attached. Andrew Stubbs