Lines Matching defs:write
1 """Functions that read and write gzipped files.
30 an existing file object to read from or write to.
59 elif hasattr(filename, "read") or hasattr(filename, "write"):
73 output.write(struct.pack("<L", value))
241 self.fileobj.write(b'\037\213') # magic header
242 self.fileobj.write(b'\010') # compression method
256 self.fileobj.write(chr(flags).encode('latin-1'))
267 self.fileobj.write(xfl)
268 self.fileobj.write(b'\377')
270 self.fileobj.write(fname + b'\000')
272 def write(self,data):
276 raise OSError(errno.EBADF, "write() on read-only GzipFile object")
279 raise ValueError("write() on closed GzipFile object")
289 self.fileobj.write(self.compress.compress(data))
300 raise OSError(errno.EBADF, "read() on write-only GzipFile object")
310 raise OSError(errno.EBADF, "read1() on write-only GzipFile object")
320 raise OSError(errno.EBADF, "peek() on write-only GzipFile object")
334 fileobj.write(self.compress.flush())
350 self.fileobj.write(self.compress.flush(zlib_mode))
365 raise OSError("Can't rewind in write mode")
385 raise OSError('Negative seek in write mode')
389 self.write(chunk)
390 self.write(b'\0' * (count % 1024))
661 g.write(chunk)