'A Recno file that is given a "backing source file" is essentially a
simple ASCII file.  Normally each record is delimited by
and so is
just a line in the file, but you can set a different record delimiter
if needed.'

def test02_WithSource(self):

    homeDir = get_new_environment_path()
    self.homeDir = homeDir
    source = os.path.join(homeDir, 'test_recno.txt')
    if (not os.path.isdir(homeDir)):
        os.mkdir(homeDir)
    f = open(source, 'w')
    f.close()
    d = db.DB()
    d.set_re_delim(10)
    d.set_re_delim('\n')
    d.set_re_source(source)
    d.open(self.filename, db.DB_RECNO, db.DB_CREATE)
    data = 'The    quick    brown    fox    jumped    over    the    lazy    dog'.split()
    for datum in data:
        d.append(datum)
    d.sync()
    d.close()
    text = open(source, 'r').read()
    text = text.strip()
    if verbose:
        print text
        print data
        print text.split('\n')
    self.assertEqual(text.split('\n'), data)
    d = db.DB()
    d.set_re_source(source)
    d.open(self.filename, db.DB_RECNO)
    d[3] = 'reddish-brown'
    d[8] = 'comatose'
    d.sync()
    d.close()
    text = open(source, 'r').read()
    text = text.strip()
    if verbose:
        print text
        print text.split('\n')
    self.assertEqual(text.split('\n'), 'The    quick    reddish-brown    fox    jumped    over    the    comatose    dog'.split())
