<div class="doctest-setup">

>>> from xix.utils.config import configFactory
>>> directory = configFactory('xix-unittests.cfg').utils.xio.data.directory
>>> from glob import glob
>>> import os.path
>>> files = glob(os.path.join(directory, '*txt'))
>>> files.sort()

</div>


Example 3.
----------

Seeking from the end of the file:

>>> from xix.utils.xio import AggregateFile
>>> fd = AggregateFile(files).open()
>>> fd.seek(-3, 2)
>>> print fd.read()[:-1]
yz

Seeking back through internal file descriptors:

>>> fd = AggregateFile(files).open()
>>> fd.seek(-6, 2)
>>> print fd.read()[:-1]
wx
yz

Seek all the way back:

>>> fd = AggregateFile(files).open()
>>> fd.seek(-31, 2)
>>> print fd.read()[:-1]
abcdef
ghijkl
mnopqr
stuvwx
yz


Over-seeking from end of file:

>>> fd = AggregateFile(files).open()
>>> try:
...     fd.seek(-23428784, 2)
... except IOError:
...     print 'ouch'
...
ouch

