def commit(self, pretend=False):
        
        if self.read_only:
            return False # give up if it's readonly - don't bother!
            
        # construct frames, footers and extensions
        framesstring = ''.join(map(lambda x: x.output(), self.frames))
        footerstring = ''
        extstring = ''
        
        if self.tag.has_key("ext") and self.tag["ext"]:
            extstring = self.construct_ext_header()
        if self.tag.has_key("footer") and self.tag["footer"]:
            footerstring = self.construct_footer()

        

        # make sure there is enough space from start of file to
        # end of tag, otherwise realign tag
        tag_content_size = len(extstring) + len(framesstring)
                
        if self.tag["size"] < tag_content_size:
            headerstring = self.construct_header(tag_content_size + \
                                                  ID3V2_FILE_DEFAULT_PADDING)
            
            # backup existing mp3 data 
            self.f.seek(self.mp3_data_offset())
            t = tempfile.TemporaryFile()
            buf = self.f.read(1024)
            while buf:
                t.write(buf)
                buf = self.f.read(1024)
                
            # write to a new file
            if not pretend:
                self.f.close()
                self.f = open(self.filename, 'wb+')
                self.f.write(headerstring)
                self.f.write(extstring)
                self.f.write(framesstring)
                self.f.write('\x00' * ID3V2_FILE_DEFAULT_PADDING)
                self.f.write(footerstring)
                
                # write mp3 data to new file
                t.seek(0)
                buf = t.read(1024)
                while buf:
                    self.f.write(buf)
                    buf = t.read(1024)
                t.close()
                self.f.close()
                
                self.f = open(self.filename, 'rb+')
                self.tag["size"] = len(headerstring) + len(extstring) + \
                                   ID3V2_FILE_DEFAULT_PADDING
            
        else:
            headerstring = self.construct_header(self.tag["size"])
            if not pretend:
                self.f.seek(0)
                self.f.write(headerstring)
                self.f.write(extstring)
                self.f.write(framesstring)
                written = len(extstring) + len(framesstring)
                warn("Written Bytes: %d" % written)
                # add padding
                self.f.write('\x00' * (self.tag["size"] - written))
                # add footerstring
                self.f.write(footerstring)
                self.f.flush()
.. todo::
dataset/ETHPy150Open Ciantic/pytagger/tagger/id3v2.py/ID3v2.commit--crossover with--dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/s3c.py/S3C.reset_censorship_cache