<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save(self, fname=''):
 """ Save the list of items to AIKIF core and optionally to local file fname """

        if fname != '':
            with open(fname, 'w') as f:
                for i in self.lstPrograms:
                    f.write(self.get_file_info_line(i, ','))

        
        # save to standard AIKIF structure
        
        filemap = mod_filemap.FileMap([], [])
        #location_fileList = filemap.get_full_filename(filemap.find_type('LOCATION'), filemap.find_ontology('FILE-PROGRAM')[0])     
        object_fileList = filemap.get_full_filename(filemap.find_type('OBJECT'), filemap.find_ontology('FILE-PROGRAM')[0])      
        print('object_fileList = ' + object_fileList + '\n')
        if os.path.exists(object_fileList):
            os.remove(object_fileList)
        self.lstPrograms.sort()

        try:
            with open(object_fileList, 'a') as f:
                f.write('\n'.join([i[0] for i in self.lstPrograms]))
        except Exception as ex:
            print('ERROR = cant write to object_filelist ' , object_fileList, str(ex))