At least on Linux, sendfile(2) operates on fds, so it should be possible to have eg:
sendFile :: Handle -> Handle -> IO ()
I need this and noticed it was missing in the current API of this library, which assumes that at least one end is a Socket.
Use cases include eg, sending a file to stdout as an efficient implementation of cat.
By the way, you're also missing a way to receive a file from a Socket and send it to a Handle.
At least on Linux, sendfile(2) operates on fds, so it should be possible to have eg:
sendFile :: Handle -> Handle -> IO ()
I need this and noticed it was missing in the current API of this library, which assumes that at least one end is a Socket.
Use cases include eg, sending a file to stdout as an efficient implementation of
cat.By the way, you're also missing a way to receive a file from a Socket and send it to a Handle.