'Dump the table HDU to a file in ASCII format.  The table may be dumped
in three separate files, one containing column definitions, one
containing header parameters, and one for table data.
Parameters
datafile : file path, file object or file-like object, optional
Output data file.  The default is the root name of the
fits file associated with this HDU appended with the
extension ``.txt``.
cdfile : file path, file object or file-like object, optional
Output column definitions file.  The default is `None`, no
column definitions output is produced.
hfile : file path, file object or file-like object, optional
Output header parameters file.  The default is `None`,
no header parameters output is produced.
overwrite : bool, optional
If ``True``, overwrite the output file if it exists. Raises an
``OSError`` (``IOError`` for Python 2) if ``False`` and the
output file exists. Default is ``False``.
.. versionchanged:: 1.3
``overwrite`` replaces the deprecated ``clobber`` argument.
Notes
The primary use for the `dump` method is to allow viewing and editing
the table data and parameters in a standard text editor.
The `load` method can be used to create a new table from the three
plain text (ASCII) files.'

@deprecated_renamed_argument('clobber', 'overwrite', '2.0')
def dump(self, datafile=None, cdfile=None, hfile=None, overwrite=False):

    exist = []
    files = [datafile, cdfile, hfile]
    for f in files:
        if isinstance(f, string_types):
            if (os.path.exists(f) and (os.path.getsize(f) != 0)):
                if overwrite:
                    warnings.warn("Overwriting    existing    file    '{}'.".format(f), AstropyUserWarning)
                    os.remove(f)
                else:
                    exist.append(f)
    if exist:
        raise IOError('        '.join(["File    '{}'    already    exists.".format(f) for f in exist]))
    self._dump_data(datafile)
    if cdfile:
        self._dump_coldefs(cdfile)
    if hfile:
        self._header.tofile(hfile, sep='\n', endcard=False, padding=False)
