'Write an old-style .ma file'

def writeMa(self, fileName, appendAxis=None, newFile=False):

    meta = {'shape': self.shape, 'type': str(self.dtype), 'info': self.infoCopy(), 'version': MetaArray.version}
    axstrs = []
    if (appendAxis is not None):
        if MetaArray.isNameType(appendAxis):
            appendAxis = self._interpretAxis(appendAxis)
        ax = meta['info'][appendAxis]
        ax['values_len'] = 'dynamic'
        if ('values' in ax):
            ax['values_type'] = str(ax['values'].dtype)
            dynXVals = ax['values']
            del ax['values']
        else:
            dynXVals = None
    for ax in meta['info']:
        if ('values' in ax):
            axstrs.append(ax['values'].tostring())
            ax['values_len'] = len(axstrs[(-1)])
            ax['values_type'] = str(ax['values'].dtype)
            del ax['values']
    if (not newFile):
        newFile = ((not os.path.exists(fileName)) or (os.stat(fileName).st_size == 0))
    if ((appendAxis is None) or newFile):
        fd = open(fileName, 'wb')
        fd.write((str(meta) + '\n\n'))
        for ax in axstrs:
            fd.write(ax)
    else:
        fd = open(fileName, 'ab')
    if (self.dtype != object):
        dataStr = self.view(np.ndarray).tostring()
    else:
        dataStr = pickle.dumps(self.view(np.ndarray))
    if (appendAxis is not None):
        frameInfo = {'len': len(dataStr), 'numFrames': self.shape[appendAxis]}
        if (dynXVals is not None):
            frameInfo['xVals'] = list(dynXVals)
        fd.write((('\n' + str(frameInfo)) + '\n'))
    fd.write(dataStr)
    fd.close()
