1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
9
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
11
TITLE="PyTables User's Guide"
12
HREF="index.html"><LINK
14
TITLE="FileNode - simulating a filesystem with PyTables"
15
HREF="c5708.html"><LINK
17
TITLE="Current limitations"
18
HREF="x5885.html"><LINK
20
TITLE="NetCDF - a PyTables
21
NetCDF3 emulation API"
22
HREF="c6061.html"></HEAD
33
SUMMARY="Header navigation table"
45
> User's Guide: Hierarchical datasets in Python - Release 1.3.2</TH
61
>Chapter 6. FileNode - simulating a filesystem with <SPAN
96
NAME="subsection6.6.1"
97
>6.6.1. Global constants</A
109
CLASS="computeroutput"
112
node system attribute.</P
120
>Supported values for
122
CLASS="computeroutput"
123
>NODE_TYPE_VERSION</SAMP
124
> node system attribute.</P
134
NAME="subsection6.6.2"
135
>6.6.2. Global functions</A
142
NAME="subsubsection6.6.2.1"
143
>6.6.2.1. newNode(h5file, where, name, title="",
144
filters=None, expectedsize=1000)</A
147
>Creates a new file node object in the specified
149
CLASS="computeroutput"
151
> file object. Additional named
153
CLASS="computeroutput"
156
CLASS="computeroutput"
159
be passed to specify where the file node is to be
160
created. Other named arguments such as
162
CLASS="computeroutput"
165
CLASS="computeroutput"
168
passed. The special named argument
170
CLASS="computeroutput"
172
>, indicating an estimate of the
173
file size in bytes, may also be passed. It returns the
182
NAME="subsubsection6.6.2.2"
183
>6.6.2.2. openNode(node, mode = 'r')</A
186
>Opens an existing file node. Returns a file node object
187
from the existing specified PyTables node. If mode is
188
not specified or it is <SAMP
189
CLASS="computeroutput"
192
only be read, and the pointer is positioned at the
193
beginning of the file. If mode is <SAMP
194
CLASS="computeroutput"
197
the file can be read and appended, and the pointer is
198
positioned at the end of the file.
207
NAME="subsection6.6.3"
215
>This is the ancestor of <SAMP
216
CLASS="computeroutput"
220
CLASS="computeroutput"
222
> (see below). Instances of these
223
classes are returned when <SAMP
224
CLASS="computeroutput"
228
CLASS="computeroutput"
230
> are called. It represents a new
231
file node associated with a <SAMP
232
CLASS="computeroutput"
235
providing a standard Python file interface to it.
238
>This abstract class provides only an implementation of
239
the reading methods needed to implement a file-like object
241
CLASS="computeroutput"
243
> node. The attribute set of
244
the node becomes available via the <SAMP
245
CLASS="computeroutput"
248
property. You can add attributes there, but try to avoid
249
attribute names in all caps or starting with
251
CLASS="computeroutput"
253
>, since they may clash with internal
257
>The node used as storage is also made available via the
258
read-only attribute <SAMP
259
CLASS="computeroutput"
262
tamper with this object unless unavoidably, since you may
263
break the operation of the file node object.
267
CLASS="computeroutput"
269
> property contains the
270
string used as a line separator, and defaults to
272
CLASS="computeroutput"
274
>. It can be set to any
275
reasonably-sized string you want.
278
>The constructor sets the <SAMP
279
CLASS="computeroutput"
283
CLASS="computeroutput"
286
CLASS="computeroutput"
287
>_lineSeparator</SAMP
289
attributes to their initial values, as well as the
291
CLASS="computeroutput"
294
CLASS="computeroutput"
297
Sub-classes should set the <SAMP
298
CLASS="computeroutput"
302
CLASS="computeroutput"
305
CLASS="computeroutput"
310
>Version 1 implements the file storage as a
312
CLASS="computeroutput"
314
> uni-dimensional <SAMP
315
CLASS="computeroutput"
324
NAME="subsubsection6.6.3.1"
336
>getLineSeparator()</B
345
>setLineSeparator()</B
358
>Returns the attribute set
367
>Flushes the file and closes
369
CLASS="computeroutput"
373
CLASS="computeroutput"
376
CLASS="computeroutput"
379
becomes no longer available.</P
387
>Returns the next line of text.
389
CLASS="computeroutput"
393
CLASS="computeroutput"
394
>file.next.__doc__</SAMP
406
CLASS="computeroutput"
410
CLASS="computeroutput"
411
>file.read.__doc__</SAMP
417
>readline(size=-1)</B
423
CLASS="computeroutput"
424
>file.readline.__doc__</SAMP
430
>readlines(sizehint=-1)</B
436
CLASS="computeroutput"
437
>file.readlines.__doc__</SAMP
443
>seek(offset, whence=0)</B
448
file position. See <SAMP
449
CLASS="computeroutput"
450
>file.seek.__doc__</SAMP
460
> Gets the current file
462
CLASS="computeroutput"
463
>file.tell.__doc__</SAMP
476
CLASS="computeroutput"
477
>file.xreadlines.__doc__</SAMP
490
NAME="subsection6.6.4"
498
>Instances of this class are returned when
500
CLASS="computeroutput"
502
> is called in read-only mode
504
CLASS="computeroutput"
506
>). This is a descendant of
508
CLASS="computeroutput"
510
> class, so it inherits all its
511
methods. Moreover, it does not define any other useful
512
method, just some protections against users intents to
521
NAME="subsection6.6.5"
529
>Instances of this class are returned when either
531
CLASS="computeroutput"
535
CLASS="computeroutput"
537
> is called in append mode
539
CLASS="computeroutput"
541
>). This is a descendant of
543
CLASS="computeroutput"
545
> class, so it inherits all its
546
methods. It provides additional methods that allow to
558
>Flushes the file node. See
560
CLASS="computeroutput"
561
>file.flush.__doc__</SAMP
567
>truncate(size=None)</B
572
node to at most <SAMP
573
CLASS="computeroutput"
575
> bytes. Currently, this
576
method only makes sense to grow the file node, since
577
data can not be rewritten nor deleted. See
579
CLASS="computeroutput"
580
>file.truncate.__doc__</SAMP
590
>Writes the string to the
591
file. Writing an empty string does nothing, but
592
requires the file to be open. See
594
CLASS="computeroutput"
595
>file.write.__doc__</SAMP
601
>writelines(sequence)</B
606
sequence of strings to the file. See
608
CLASS="computeroutput"
609
>file.writelines.__doc__</SAMP
622
SUMMARY="Footer navigation table"
661
>Current limitations</TD
679
NetCDF3 emulation API</TD
b'\\ No newline at end of file'