Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 4726f970c4b56b9a0ebb9a03a0b6522e > files > 181

python-tables-doc-3.0.0-4.mga4.noarch.rpm




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Filenode Module &mdash; PyTables 3.0.0 documentation</title>
    
    <link rel="stylesheet" href="../../_static/cloud.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../../" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '3.0.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../_static/toggle_sections.js"></script>
    <script type="text/javascript" src="../../_static/toggle_sidebar.js"></script>
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
    <link rel="top" title="PyTables 3.0.0 documentation" href="../../index.html" />
    <link rel="up" title="Library Reference" href="../libref.html" />
    <link rel="next" title="Optimization tips" href="../optimization.html" />
    <link rel="prev" title="General purpose expression evaluator class" href="expr_class.html" /> 
  </head>
  <body>
    <div class="relbar-top">
        
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="../../np-modindex.html" title="Python Module Index"
             >modules</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="../optimization.html" title="Optimization tips"
             accesskey="N">next</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="expr_class.html" title="General purpose expression evaluator class"
             accesskey="P">previous</a> &nbsp; &nbsp;</li>
    <li><a href="../../index.html">PyTables 3.0.0 documentation</a> &raquo;</li>

          <li><a href="../index.html" >PyTables User&#8217;s Guide</a> &raquo;</li>
          <li><a href="../libref.html" accesskey="U">Library Reference</a> &raquo;</li> 
      </ul>
    </div>
    </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-tables.nodes.filenode">
<span id="filenode-module"></span><span id="filenode-classes"></span><h1>Filenode Module<a class="headerlink" href="#module-tables.nodes.filenode" title="Permalink to this headline">¶</a></h1>
<p>A file interface to nodes for PyTables databases.</p>
<p>The FileNode module provides a file interface for using inside of
PyTables database files.  Use the new_node() function to create a brand
new file node which can be read and written as any ordinary Python
file.  Use the open_node() function to open an existing (i.e. created
with new_node()) node for read-only or read-write access.  Read acces
is always available.  Write access (enabled on new files and files
opened with mode &#8216;a+&#8217;) only allows appending data to a file node.</p>
<p>Currently only binary I/O is supported.</p>
<p>See <a class="reference internal" href="../filenode.html#filenode-usersguide"><em>filenode - simulating a filesystem with PyTables</em></a> for instructions on use.</p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 3.0: </span>In version 3.0 the module as been completely rewritten to be fully
compliant with the interfaces defined in the <tt class="xref py py-mod docutils literal"><span class="pre">io</span></tt> module.</p>
<div class="section" id="module-constants">
<h2>Module constants<a class="headerlink" href="#module-constants" title="Permalink to this headline">¶</a></h2>
<dl class="data">
<dt id="tables.nodes.filenode.NodeType">
<tt class="descclassname">tables.nodes.filenode.</tt><tt class="descname">NodeType</tt><em class="property"> = 'file'</em><a class="headerlink" href="#tables.nodes.filenode.NodeType" title="Permalink to this definition">¶</a></dt>
<dd><p>Value for NODE_TYPE node system attribute.</p>
</dd></dl>

<dl class="data">
<dt id="tables.nodes.filenode.NodeTypeVersions">
<tt class="descclassname">tables.nodes.filenode.</tt><tt class="descname">NodeTypeVersions</tt><em class="property"> = [1, 2]</em><a class="headerlink" href="#tables.nodes.filenode.NodeTypeVersions" title="Permalink to this definition">¶</a></dt>
<dd><p>Supported values for NODE_TYPE_VERSION node system attribute.</p>
</dd></dl>

</div>
<div class="section" id="module-functions">
<h2>Module functions<a class="headerlink" href="#module-functions" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="tables.nodes.filenode.new_node">
<tt class="descclassname">tables.nodes.filenode.</tt><tt class="descname">new_node</tt><big>(</big><em>h5file</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#new_node"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.new_node" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a new file node object in the specified PyTables file object.</p>
<p>Additional named arguments where and name must be passed to specify where
the file node is to be created. Other named arguments such as title and
filters may also be passed.</p>
<p>The special named argument expectedsize, indicating an estimate of the
file size in bytes, may also be passed. It returns the file node object.</p>
</dd></dl>

<dl class="function">
<dt id="tables.nodes.filenode.open_node">
<tt class="descclassname">tables.nodes.filenode.</tt><tt class="descname">open_node</tt><big>(</big><em>node</em>, <em>mode='r'</em><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#open_node"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.open_node" title="Permalink to this definition">¶</a></dt>
<dd><p>Opens an existing file node.</p>
<p>Returns a file node object from the existing specified PyTables node.
If mode is not specified or it is &#8216;r&#8217;, the file can only be read,
and the pointer is positioned at the beginning of the file.
If mode is &#8216;a+&#8217;, the file can be read and appended, and the pointer
is positioned at the end of the file.</p>
</dd></dl>

</div>
<div class="section" id="the-rawpytablesio-base-class">
<h2>The RawPyTablesIO base class<a class="headerlink" href="#the-rawpytablesio-base-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="tables.nodes.filenode.RawPyTablesIO">
<em class="property">class </em><tt class="descclassname">tables.nodes.filenode.</tt><tt class="descname">RawPyTablesIO</tt><big>(</big><em>node</em>, <em>mode=None</em><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for raw binary I/O on HDF5 files using PyTables.</p>
</dd></dl>

<div class="section" id="rawpytablesio-attributes">
<h3>RawPyTablesIO attributes<a class="headerlink" href="#rawpytablesio-attributes" title="Permalink to this headline">¶</a></h3>
<dl class="attribute">
<dt id="tables.nodes.filenode.RawPyTablesIO.mode">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">mode</tt><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.mode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.mode" title="Permalink to this definition">¶</a></dt>
<dd><p>File mode</p>
</dd></dl>

</div>
<div class="section" id="rawpytablesio-methods">
<h3>RawPyTablesIO methods<a class="headerlink" href="#rawpytablesio-methods" title="Permalink to this headline">¶</a></h3>
<dl class="method">
<dt id="tables.nodes.filenode.RawPyTablesIO.tell">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">tell</tt><big>(</big><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.tell"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.tell" title="Permalink to this definition">¶</a></dt>
<dd><p>Return current stream position.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RawPyTablesIO.seek">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">seek</tt><big>(</big><em>pos</em>, <em>whence=0</em><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.seek"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.seek" title="Permalink to this definition">¶</a></dt>
<dd><p>Change stream position.</p>
<p>Change the stream position to byte offset offset. offset is
interpreted relative to the position indicated by whence.  Values
for whence are:</p>
<ul class="simple">
<li>0 &#8211; start of stream (the default); offset should be zero or positive</li>
<li>1 &#8211; current stream position; offset may be negative</li>
<li>2 &#8211; end of stream; offset is usually negative</li>
</ul>
<p>Return the new absolute position.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RawPyTablesIO.seekable">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">seekable</tt><big>(</big><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.seekable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.seekable" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether object supports random access.</p>
<p>If False, seek(), tell() and truncate() will raise IOError.
This method may need to do a test seek().</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RawPyTablesIO.fileno">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">fileno</tt><big>(</big><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.fileno"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.fileno" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns underlying file descriptor if one exists.</p>
<p>An IOError is raised if the IO object does not use a file descriptor.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RawPyTablesIO.close">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Flush and close the IO object.</p>
<p>This method has no effect if the file is already closed.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RawPyTablesIO.flush">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">flush</tt><big>(</big><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.flush"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.flush" title="Permalink to this definition">¶</a></dt>
<dd><p>Flush write buffers, if applicable.</p>
<p>This is not implemented for read-only and non-blocking streams.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RawPyTablesIO.truncate">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">truncate</tt><big>(</big><em>pos=None</em><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.truncate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.truncate" title="Permalink to this definition">¶</a></dt>
<dd><p>Truncate file to size bytes.</p>
<p>Size defaults to the current IO position as reported by tell().
Return the new size.</p>
<p>Currently, this method only makes sense to grow the file node,
since data can not be rewritten nor deleted.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RawPyTablesIO.readable">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">readable</tt><big>(</big><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.readable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.readable" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether object was opened for reading.</p>
<p>If False, read() will raise IOError.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RawPyTablesIO.writable">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">writable</tt><big>(</big><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.writable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.writable" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether object was opened for writing.</p>
<p>If False, write() and truncate() will raise IOError.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RawPyTablesIO.readinto">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">readinto</tt><big>(</big><em>b</em><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.readinto"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.readinto" title="Permalink to this definition">¶</a></dt>
<dd><p>Read up to len(b) bytes into b.</p>
<p>Returns number of bytes read (0 for EOF), or None if the object
is set not to block as has no data to read.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RawPyTablesIO.readline">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">readline</tt><big>(</big><em>limit=-1</em><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.readline"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.readline" title="Permalink to this definition">¶</a></dt>
<dd><p>Read and return a line from the stream.</p>
<p>If limit is specified, at most limit bytes will be read.</p>
<p>The line terminator is always <tt class="docutils literal"><span class="pre">\n</span></tt> for binary files; for text
files, the newlines argument to open can be used to select the line
terminator(s) recognized.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RawPyTablesIO.write">
<tt class="descclassname">RawPyTablesIO.</tt><tt class="descname">write</tt><big>(</big><em>b</em><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RawPyTablesIO.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RawPyTablesIO.write" title="Permalink to this definition">¶</a></dt>
<dd><p>Write the given buffer to the IO stream.</p>
<p>Returns the number of bytes written, which may be less than len(b).</p>
</dd></dl>

</div>
</div>
<div class="section" id="the-rofilenode-class">
<h2>The ROFileNode class<a class="headerlink" href="#the-rofilenode-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="tables.nodes.filenode.ROFileNode">
<em class="property">class </em><tt class="descclassname">tables.nodes.filenode.</tt><tt class="descname">ROFileNode</tt><big>(</big><em>node</em><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#ROFileNode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.ROFileNode" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a new read-only file node.</p>
<p>Creates a new read-only file node associated with the specified
PyTables node, providing a standard Python file interface to it.
The node has to have been created on a previous occasion
using the new_node() function.</p>
<p>The node used as storage is also made available via the read-only
attribute node.  Please do not tamper with this object if it&#8217;s
avoidable, since you may break the operation of the file node object.</p>
<p>The constructor is not intended to be used directly.
Use the open_node() function in read-only mode (&#8216;r&#8217;) instead.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Version 1:</th><td class="field-body">implements the file storage as a UInt8 uni-dimensional EArray.</td>
</tr>
<tr class="field-even field"><th class="field-name">Version 2:</th><td class="field-body">uses an UInt8 N vector EArray.</td>
</tr>
</tbody>
</table>
<p class="versionchanged">
<span class="versionmodified">Changed in version 3.0: </span>The offset attribute is no more available, please use seek/tell
methods instead.</p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 3.0: </span>The line_separator property is no more available.
The only line separator used for binary I/O is <tt class="docutils literal"><span class="pre">\n</span></tt>.</p>
</dd></dl>

<div class="section" id="rofilenode-attributes">
<h3>ROFileNode attributes<a class="headerlink" href="#rofilenode-attributes" title="Permalink to this headline">¶</a></h3>
<dl class="attribute">
<dt id="tables.nodes.filenode.ROFileNode.attrs">
<tt class="descclassname">ROFileNode.</tt><tt class="descname">attrs</tt><a class="headerlink" href="#tables.nodes.filenode.ROFileNode.attrs" title="Permalink to this definition">¶</a></dt>
<dd><p>A property pointing to the attribute set of the file node.</p>
</dd></dl>

</div>
<div class="section" id="rofilenode-methods">
<h3>ROFileNode methods<a class="headerlink" href="#rofilenode-methods" title="Permalink to this headline">¶</a></h3>
<dl class="method">
<dt id="tables.nodes.filenode.ROFileNode.flush">
<tt class="descclassname">ROFileNode.</tt><tt class="descname">flush</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.ROFileNode.flush" title="Permalink to this definition">¶</a></dt>
<dd><p>Flush write buffers, if applicable.</p>
<p>This is not implemented for read-only and non-blocking streams.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.ROFileNode.read">
<tt class="descclassname">ROFileNode.</tt><tt class="descname">read</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.ROFileNode.read" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.ROFileNode.readline">
<tt class="descclassname">ROFileNode.</tt><tt class="descname">readline</tt><big>(</big><em>limit=-1</em><big>)</big><a class="headerlink" href="#tables.nodes.filenode.ROFileNode.readline" title="Permalink to this definition">¶</a></dt>
<dd><p>Read and return a line from the stream.</p>
<p>If limit is specified, at most limit bytes will be read.</p>
<p>The line terminator is always <tt class="docutils literal"><span class="pre">\n</span></tt> for binary files; for text
files, the newlines argument to open can be used to select the line
terminator(s) recognized.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.ROFileNode.readlines">
<tt class="descclassname">ROFileNode.</tt><tt class="descname">readlines</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.ROFileNode.readlines" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of lines from the stream.</p>
<p>hint can be specified to control the number of lines read: no more
lines will be read if the total size (in bytes/characters) of all
lines so far exceeds hint.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.ROFileNode.close">
<tt class="descclassname">ROFileNode.</tt><tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.ROFileNode.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Flush and close the IO object.</p>
<p>This method has no effect if the file is already closed.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.ROFileNode.seek">
<tt class="descclassname">ROFileNode.</tt><tt class="descname">seek</tt><big>(</big><em>pos</em>, <em>whence=0</em><big>)</big><a class="headerlink" href="#tables.nodes.filenode.ROFileNode.seek" title="Permalink to this definition">¶</a></dt>
<dd><p>Change stream position.</p>
<p>Change the stream position to byte offset offset. offset is
interpreted relative to the position indicated by whence.  Values
for whence are:</p>
<ul class="simple">
<li>0 &#8211; start of stream (the default); offset should be zero or positive</li>
<li>1 &#8211; current stream position; offset may be negative</li>
<li>2 &#8211; end of stream; offset is usually negative</li>
</ul>
<p>Return the new absolute position.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.ROFileNode.tell">
<tt class="descclassname">ROFileNode.</tt><tt class="descname">tell</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.ROFileNode.tell" title="Permalink to this definition">¶</a></dt>
<dd><p>Return current stream position.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.ROFileNode.readable">
<tt class="descclassname">ROFileNode.</tt><tt class="descname">readable</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.ROFileNode.readable" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether object was opened for reading.</p>
<p>If False, read() will raise IOError.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.ROFileNode.writable">
<tt class="descclassname">ROFileNode.</tt><tt class="descname">writable</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.ROFileNode.writable" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether object was opened for writing.</p>
<p>If False, write() and truncate() will raise IOError.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.ROFileNode.seekable">
<tt class="descclassname">ROFileNode.</tt><tt class="descname">seekable</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.ROFileNode.seekable" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether object supports random access.</p>
<p>If False, seek(), tell() and truncate() will raise IOError.
This method may need to do a test seek().</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.ROFileNode.fileno">
<tt class="descclassname">ROFileNode.</tt><tt class="descname">fileno</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.ROFileNode.fileno" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns underlying file descriptor if one exists.</p>
<p>An IOError is raised if the IO object does not use a file descriptor.</p>
</dd></dl>

</div>
</div>
<div class="section" id="the-rafilenode-class">
<h2>The RAFileNode class<a class="headerlink" href="#the-rafilenode-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="tables.nodes.filenode.RAFileNode">
<em class="property">class </em><tt class="descclassname">tables.nodes.filenode.</tt><tt class="descname">RAFileNode</tt><big>(</big><em>node</em>, <em>h5file</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="../../_modules/tables/nodes/filenode.html#RAFileNode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tables.nodes.filenode.RAFileNode" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a new read-write file node.</p>
<p>The first syntax opens the specified PyTables node, while the
second one creates a new node in the specified PyTables file.
In the second case, additional named arguments &#8216;where&#8217; and &#8216;name&#8217;
must be passed to specify where the file node is to be created.
Other named arguments such as &#8216;title&#8217; and &#8216;filters&#8217; may also be
passed.  The special named argument &#8216;expectedsize&#8217;, indicating an
estimate of the file size in bytes, may also be passed.</p>
<p>Write access means reading as well as appending data is allowed.</p>
<p>The node used as storage is also made available via the read-only
attribute node.  Please do not tamper with this object if it&#8217;s
avoidable, since you may break the operation of the file node object.</p>
<p>The constructor is not intended to be used directly.
Use the new_node() or open_node() functions instead.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Version 1:</th><td class="field-body">implements the file storage as a UInt8 uni-dimensional EArray.</td>
</tr>
<tr class="field-even field"><th class="field-name">Version 2:</th><td class="field-body">uses an UInt8 N vector EArray.</td>
</tr>
</tbody>
</table>
<p class="versionchanged">
<span class="versionmodified">Changed in version 3.0: </span>The offset attribute is no more available, please use seek/tell
methods instead.</p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 3.0: </span>The line_separator property is no more available.
The only line separator used for binary I/O is <tt class="docutils literal"><span class="pre">\n</span></tt>.</p>
</dd></dl>

<div class="section" id="rafilenode-attributes">
<h3>RAFileNode attributes<a class="headerlink" href="#rafilenode-attributes" title="Permalink to this headline">¶</a></h3>
<dl class="attribute">
<dt id="tables.nodes.filenode.RAFileNode.attrs">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">attrs</tt><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.attrs" title="Permalink to this definition">¶</a></dt>
<dd><p>A property pointing to the attribute set of the file node.</p>
</dd></dl>

</div>
<div class="section" id="rafilenode-methods">
<h3>RAFileNode methods<a class="headerlink" href="#rafilenode-methods" title="Permalink to this headline">¶</a></h3>
<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.flush">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">flush</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.flush" title="Permalink to this definition">¶</a></dt>
<dd><p>Flush write buffers, if applicable.</p>
<p>This is not implemented for read-only and non-blocking streams.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.read">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">read</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.read" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.readline">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">readline</tt><big>(</big><em>limit=-1</em><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.readline" title="Permalink to this definition">¶</a></dt>
<dd><p>Read and return a line from the stream.</p>
<p>If limit is specified, at most limit bytes will be read.</p>
<p>The line terminator is always <tt class="docutils literal"><span class="pre">\n</span></tt> for binary files; for text
files, the newlines argument to open can be used to select the line
terminator(s) recognized.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.readlines">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">readlines</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.readlines" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of lines from the stream.</p>
<p>hint can be specified to control the number of lines read: no more
lines will be read if the total size (in bytes/characters) of all
lines so far exceeds hint.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.truncate">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">truncate</tt><big>(</big><em>pos=None</em><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.truncate" title="Permalink to this definition">¶</a></dt>
<dd><p>Truncate file to size bytes.</p>
<p>Size defaults to the current IO position as reported by tell().
Return the new size.</p>
<p>Currently, this method only makes sense to grow the file node,
since data can not be rewritten nor deleted.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.write">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">write</tt><big>(</big><em>b</em><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.write" title="Permalink to this definition">¶</a></dt>
<dd><p>Write the given buffer to the IO stream.</p>
<p>Returns the number of bytes written, which may be less than len(b).</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.writelines">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">writelines</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.writelines" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.close">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Flush and close the IO object.</p>
<p>This method has no effect if the file is already closed.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.seek">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">seek</tt><big>(</big><em>pos</em>, <em>whence=0</em><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.seek" title="Permalink to this definition">¶</a></dt>
<dd><p>Change stream position.</p>
<p>Change the stream position to byte offset offset. offset is
interpreted relative to the position indicated by whence.  Values
for whence are:</p>
<ul class="simple">
<li>0 &#8211; start of stream (the default); offset should be zero or positive</li>
<li>1 &#8211; current stream position; offset may be negative</li>
<li>2 &#8211; end of stream; offset is usually negative</li>
</ul>
<p>Return the new absolute position.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.tell">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">tell</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.tell" title="Permalink to this definition">¶</a></dt>
<dd><p>Return current stream position.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.readable">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">readable</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.readable" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether object was opened for reading.</p>
<p>If False, read() will raise IOError.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.writable">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">writable</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.writable" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether object was opened for writing.</p>
<p>If False, write() and truncate() will raise IOError.</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.seekable">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">seekable</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.seekable" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether object supports random access.</p>
<p>If False, seek(), tell() and truncate() will raise IOError.
This method may need to do a test seek().</p>
</dd></dl>

<dl class="method">
<dt id="tables.nodes.filenode.RAFileNode.fileno">
<tt class="descclassname">RAFileNode.</tt><tt class="descname">fileno</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.nodes.filenode.RAFileNode.fileno" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns underlying file descriptor if one exists.</p>
<p>An IOError is raised if the IO object does not use a file descriptor.</p>
</dd></dl>

</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
        <p class="logo"><a href="../../index.html">
          <img class="logo" src="../../_static/logo-pytables-small.png" alt="Logo"/>
        </a></p>
  <h3><a href="../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Filenode Module</a><ul>
<li><a class="reference internal" href="#module-constants">Module constants</a></li>
<li><a class="reference internal" href="#module-functions">Module functions</a></li>
<li><a class="reference internal" href="#the-rawpytablesio-base-class">The RawPyTablesIO base class</a><ul>
<li><a class="reference internal" href="#rawpytablesio-attributes">RawPyTablesIO attributes</a></li>
<li><a class="reference internal" href="#rawpytablesio-methods">RawPyTablesIO methods</a></li>
</ul>
</li>
<li><a class="reference internal" href="#the-rofilenode-class">The ROFileNode class</a><ul>
<li><a class="reference internal" href="#rofilenode-attributes">ROFileNode attributes</a></li>
<li><a class="reference internal" href="#rofilenode-methods">ROFileNode methods</a></li>
</ul>
</li>
<li><a class="reference internal" href="#the-rafilenode-class">The RAFileNode class</a><ul>
<li><a class="reference internal" href="#rafilenode-attributes">RAFileNode attributes</a></li>
<li><a class="reference internal" href="#rafilenode-methods">RAFileNode methods</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="expr_class.html"
                        title="previous chapter">General purpose expression evaluator class</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../optimization.html"
                        title="next chapter">Optimization tips</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/usersguide/libref/filenode_classes.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="relbar-bottom">
        
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="../../np-modindex.html" title="Python Module Index"
             >modules</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="../optimization.html" title="Optimization tips"
             >next</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="expr_class.html" title="General purpose expression evaluator class"
             >previous</a> &nbsp; &nbsp;</li>
    <li><a href="../../index.html">PyTables 3.0.0 documentation</a> &raquo;</li>

          <li><a href="../index.html" >PyTables User&#8217;s Guide</a> &raquo;</li>
          <li><a href="../libref.html" >Library Reference</a> &raquo;</li> 
      </ul>
    </div>
    </div>

    <div class="footer">
        &copy; Copyright 2011-2013, PyTables maintainers.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
    <!-- cloud_sptheme 1.3 -->
  </body>
</html>