(self, filename, linktype=None, gz=False, endianness="", append=False, sync=False)
linktype: force linktype to a given value. If None, linktype is taken
                  from the first writter packet
        gz: compress the capture on the fly
        endianness: force an endianness (little:"<", big:">"). Default is native
        append: append packets to the capture file instead of truncating it
        sync: do not bufferize writes to the capture file
linktype: force linktype to a given value. If None, linktype is taken
                  from the first writter packet
        gz: compress the capture on the fly
        endianness: force an endianness (little:"<", big:">"). Default is native
        append: append packets to the capture file instead of truncating it
        sync: do not bufferize writes to the capture file
linktype : force linktype to a given value . If None linktype is taken from the first writter packet gz : compress the capture on the fly endianness : force an endianness ( little : < big : > ) . Default is native append : append packets to the capture file instead of truncating it sync : do not bufferize writes to the capture file
def __init__(self, filename, linktype=None, gz=False, endianness="", append=False, sync=False):
        """
        linktype: force linktype to a given value. If None, linktype is taken
                  from the first writter packet
        gz: compress the capture on the fly
        endianness: force an endianness (little:"<", big:">"). Default is native
        append: append packets to the capture file instead of truncating it
        sync: do not bufferize writes to the capture file
        """
        
        self.linktype = linktype
        self.header_present = 0
        self.append=append
        self.gz = gz
        self.endian = endianness
        self.filename=filename
        self.sync=sync
        bufsz=4096
        if sync:
            bufsz=0

        self.f = [open,gzip.open][gz](filename,append and "ab" or "wb", gz and 9 or bufsz)
def __init__ ( self , filename , linktype = None , gz = False , endianness = "" , append = False , sync = False ) : self . linktype = linktype self . header_present = 0 self . append = append self . gz = gz self . endian = endianness self . filename = filename self . sync = sync bufsz = 4096 if sync : bufsz = 0 self . f = [ open , gzip . open ] [ gz ] ( filename , append and "ab" or "wb" , gz and 9 or bufsz )