EVOLUTION-MANAGER
Edit File: file_writer.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: File Writer</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for file_writer {curl}"><tr><td>file_writer {curl}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>File Writer</h2> <h3>Description</h3> <p>Generates a closure that writes binary (raw) data to a file. </p> <h3>Usage</h3> <pre> file_writer(path) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>path</code></td> <td> <p>file name or path on disk</p> </td></tr> </table> <h3>Details</h3> <p>The writer function automatically opens the file on the first write and closes when it goes out of scope, or explicitly by setting <code>close = TRUE</code>. This can be used for the <code>data</code> callback in <code>multi_add()</code> or <code>curl_fetch_multi()</code>. </p> <h3>Value</h3> <p>Function with signature <code>writer(data = raw(), close = FALSE)</code> </p> <h3>Examples</h3> <pre> # Doesn't open yet tmp <- tempfile() writer <- file_writer(tmp) # Now it opens writer(charToRaw("Hello!\n")) writer(charToRaw("How are you?\n")) # Close it! writer(charToRaw("All done!\n"), close = TRUE) # Check it worked readLines(tmp) </pre> <hr /><div style="text-align: center;">[Package <em>curl</em> version 4.3 <a href="00Index.html">Index</a>]</div> </body></html>