<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>

Reading an aggregate file byte by byte:

>>> from xix.utils.xio import AggregateFile
>>> fd = AggregateFile(files).open()
>>> next = fd.read(1)
>>> while next:
...    if next != '\n':
...        print next,
...    next = fd.read(1)
...
a b c d e f g h i j k l m n o p q r s t u v w x y z

Read whole aggregate file:

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


