Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support Handle to Handle sendfile #4

Open
joeyh opened this issue Jun 25, 2024 · 1 comment
Open

support Handle to Handle sendfile #4

joeyh opened this issue Jun 25, 2024 · 1 comment

Comments

@joeyh
Copy link

joeyh commented Jun 25, 2024

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.

@stepcut
Copy link
Member

stepcut commented Jun 25, 2024

That is likely all true.

The initial aim of this library was to provide a consist API across Linux/Windows/Darwin/FreeBSD for the minimal sendfile functionality required to implement happstack-server.

I am not opposed to you adding additional functionality -- though adding functions that are only available on some OSes and not others raised questions about the PVP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants