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

Add support for :writedata/:file options -- write body directly to a file #100

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

baconz
Copy link

@baconz baconz commented Feb 9, 2015

Managing the open file handles on easy isn't the greatest, but I'm not sure of another way to make this work, and it is a very handy feature to have.

Totally open to suggestions for improvements, and I can understand it if you think that this does not belong in such a light wrapper.

These options take a file path as a string, and will write
the body of the response directly to the passed path, instead
of pulling it into the heap.

When passed, these options set :writefunction to NULL, so that
Curl knows to write directly to a file.

Easy manages the file handle, and closes it automatically in
on_complete.
@hanshasselberg
Copy link
Member

thanks for your work @baconz! I will go through it as soon as I have time! :)

@baconz
Copy link
Author

baconz commented Feb 9, 2015

Cool, sounds good. Looks like there's a problem on ruby 1.8 -- I'll check it out later today.

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

Successfully merging this pull request may close these issues.

2 participants