def zip(self):
        """
            return a data stream of the files compressed in zip format.
            Returns None if the list is empty. 
        """
        import cStringIO, zipfile
        fobj = cStringIO.StringIO()
        # make sure the list contains something
        if len(self) >= 0:
            try:
                zip = zipfile.ZipFile(fobj, "w", zipfile.ZIP_DEFLATED)
            except:
                sys.stderr.write("Unable to open zip file.")
                raise
            try:
                for name in self:
                    # only add files
                    if os.path.isfile(name):
                        zip.write(name)
                zip.close()
                return fobj.getvalue()
            finally:
                fobj.close()
        else:
            # return None if the list is empty. 
            return None

            return a data stream of the files compressed in zip format.
            Returns None if the list is empty. 
        
recipes/Python/259147_FSList/recipe-259147.py