Skip to content

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

Open
baconz wants to merge 3 commits intotyphoeus:masterfrom
baconz:master
Open

Add support for :writedata/:file options -- write body directly to a file#100
baconz wants to merge 3 commits intotyphoeus:masterfrom
baconz:master

Conversation

@baconz
Copy link
Copy Markdown

@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
Copy Markdown
Member

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

@baconz
Copy link
Copy Markdown
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