'Write the column definition parameters in the ASCII format read by
BinTableHDU.load() to fileobj.'

def _dump_coldefs(self, fileobj):

    close_file = False
    if isinstance(fileobj, string_types):
        fileobj = open(fileobj, 'w')
        close_file = True
    for column in self.columns:
        line = [column.name, column.format]
        attrs = ['disp', 'unit', 'dim', 'null', 'bscale', 'bzero']
        line += ['{:16s}'.format((value if value else '""')) for value in (getattr(column, attr) for attr in attrs)]
        fileobj.write('    '.join(line))
        fileobj.write('\n')
    if close_file:
        fileobj.close()
