I was having problems with sending data to a stream via the of:= method. Tracked it down to the process not having a chance to finish. The patch below is a stab at implementing the pclose2() method for streamed output. This already required keeping a handle around for the stream, rather than just the fileno.
At them moment, I'm not using the functionality to send hashes to multiple outputs. I put in the code (commented out) in the patch, but it still needs to have a check to make sure a file handle doesn't get closed twice. As such, I believe this would still be susceptible to truncation of the data.
On the plus side, the internal hashing functions work fine. As such, a verification of the resultant image will immediately show that the image is not complete.
Dave
patch described implementing pclose