EVOLUTION-MANAGER
Edit File: rawConnection.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: Raw Connections</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 rawConnection {base}"><tr><td>rawConnection {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Raw Connections</h2> <h3>Description</h3> <p>Input and output raw connections. </p> <h3>Usage</h3> <pre> rawConnection(object, open = "r") rawConnectionValue(con) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object</code></td> <td> <p>character or raw vector. A description of the connection. For an input this is an <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> raw vector object, and for an output connection the name for the connection. </p> </td></tr> <tr valign="top"><td><code>open</code></td> <td> <p>character. Any of the standard connection open modes.</p> </td></tr> <tr valign="top"><td><code>con</code></td> <td> <p>An output raw connection.</p> </td></tr> </table> <h3>Details</h3> <p>An input raw connection is opened and the raw vector is copied at the time the connection object is created, and <code>close</code> destroys the copy. </p> <p>An output raw connection is opened and creates an <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> raw vector internally. The raw vector can be retrieved <em>via</em> <code>rawConnectionValue</code>. </p> <p>If a connection is open for both input and output the initial raw vector supplied is copied when the connections is open </p> <h3>Value</h3> <p>For <code>rawConnection</code>, a connection object of class <code>"rawConnection"</code> which inherits from class <code>"connection"</code>. </p> <p>For <code>rawConnectionValue</code>, a raw vector. </p> <h3>Note</h3> <p>As output raw connections keep the internal raw vector up to date call-by-call, they are relatively expensive to use (although over-allocation is used), and it may be better to use an anonymous <code><a href="connections.html">file</a>()</code> connection to collect output. </p> <p>On (rare) platforms where <code>vsnprintf</code> does not return the needed length of output there is a 100,000 character limit on the length of line for output connections: longer lines will be truncated with a warning. </p> <h3>See Also</h3> <p><code><a href="connections.html">connections</a></code>, <code><a href="showConnections.html">showConnections</a></code>. </p> <h3>Examples</h3> <pre> zz <- rawConnection(raw(0), "r+") # start with empty raw vector writeBin(LETTERS, zz) seek(zz, 0) readLines(zz) # raw vector has embedded nuls seek(zz, 0) writeBin(letters[1:3], zz) rawConnectionValue(zz) close(zz) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>