Why is NamedPipe so strict?

I’m looking into using NamedPipe for some IPC. I noticed that when reading from the pipe, it will only succeed if it reads exactly the number of bytes you requested. If it reads fewer bytes, it blocks if no timeout is specified or fails (return -1) if a timeout is specified.

In my case, I don’t know how many bytes I will be receiving, so it would be useful to instead return the number of bytes read if the timeout expires. Here’s a diff which does what I want, whilst preserving the existing behaviour in the default case.

Would this be considered for inclusion in JUCE?

named-pipe.diff (8.0 KB)