Lines Matching defs:fp
134 def _check_zipfile(fp):
136 if _EndRecData(fp):
150 result = _check_zipfile(fp=filename)
152 with open(filename, "rb") as fp:
153 result = _check_zipfile(fp)
720 fp = None # Set here since __del__ checks it
752 self.fp = open(file, modeDict[mode])
756 self.fp = open(file, modeDict[mode])
761 self.fp = file
776 self.fp.seek(self.start_dir, 0)
779 self.fp.seek(0, 2)
787 fp = self.fp
788 self.fp = None
790 fp.close()
801 fp = self.fp
803 endrec = _EndRecData(fp)
825 fp.seek(self.start_dir, 0)
826 data = fp.read(size_cd)
827 fp = cStringIO.StringIO(data)
830 centdir = fp.read(sizeCentralDir)
838 filename = fp.read(centdir[_CD_FILENAME_LENGTH])
841 x.extra = fp.read(centdir[_CD_EXTRA_FIELD_LENGTH])
842 x.comment = fp.read(centdir[_CD_COMMENT_LENGTH])
937 if not self.fp:
944 zef_file = self.fp
1091 if not self.fp:
1110 if not self.fp:
1135 zinfo.header_offset = self.fp.tell() # Start of header bytes
1146 self.fp.write(zinfo.FileHeader(False))
1149 with open(filename, "rb") as fp:
1156 self.fp.write(zinfo.FileHeader(zip64))
1164 buf = fp.read(1024 * 8)
1172 self.fp.write(buf)
1176 self.fp.write(buf)
1189 position = self.fp.tell() # Preserve current position in file
1190 self.fp.seek(zinfo.header_offset, 0)
1191 self.fp.write(zinfo.FileHeader(zip64))
1192 self.fp.seek(position, 0)
1209 if not self.fp:
1217 zinfo.header_offset = self.fp.tell() # Start of header bytes
1232 self.fp.write(zinfo.FileHeader(zip64))
1233 self.fp.write(bytes)
1237 self.fp.write(struct.pack(fmt, zinfo.CRC, zinfo.compress_size,
1239 self.fp.flush()
1250 if self.fp is None:
1256 pos1 = self.fp.tell()
1312 self.fp.write(centdir)
1313 self.fp.write(filename)
1314 self.fp.write(extra_data)
1315 self.fp.write(zinfo.comment)
1317 pos2 = self.fp.tell()
1330 self.fp.write(zip64endrec)
1335 self.fp.write(zip64locrec)
1343 self.fp.write(endrec)
1344 self.fp.write(self._comment)
1345 self.fp.flush()
1347 fp = self.fp
1348 self.fp = None
1350 fp.close()
1501 with open(tgt, 'wb') as fp:
1502 fp.write(zf.read(path))