How to read a specified number of bytes from a channel

I wasn’t able to find such function in the Stdlib. Does it exist or do I need to resort to low-level functions from the Unix module?

There is Stdlib.input that reads at most n bytes from a channel?

Stdlib.really_input should do exactly what you need.

Yes, I ended up using Stdlib.really_input_string.