Пример #1
0
 def pread(self, size=None, pos=None):
     """Read *pos*-length data starting from position *pos*.
     This operation doesn't change the pointer position."""
     size = int(self.size) if size is None else int(size)
     pos = int(self.pos if pos is None else pos)
     if size < 0:
         raise ValueError("invalid size, %d" % size)
     chunk = unistd.pread(self.fd, size, pos)
     return chunk
Пример #2
0
 def pread(self, size=None, pos=None):
     """Read *pos*-length data starting from position *pos*.
     This operation doesn't change the pointer position."""
     size = int(self.size) if size is None else int(size)
     pos = int(self.pos if pos is None else pos)
     if size < 0:
         raise ValueError("invalid size, %d" % size)
     chunk = unistd.pread(self.fd, size, pos)
     return chunk
Пример #3
0
 def read(self, size=None, pos=None):
     """Read *pos*-length data starting from position *pos*."""
     size = int(self.size) if size is None else int(size)
     pos = int(self.pos if pos is None else pos)
     if size < 0:
         raise ValueError("invalid size, %d" % size)
     chunk = unistd.pread(self.fd, size, pos)
     self.pos = pos + len(chunk)
     return chunk
Пример #4
0
 def read(self, size=None, pos=None):
     """Read *pos*-length data starting from position *pos*."""
     size = int(self.size) if size is None else int(size)
     pos = int(self.pos if pos is None else pos)
     if size < 0:
         raise ValueError("invalid size, %d" % size)
     chunk = unistd.pread(self.fd, size, pos)
     self.pos = pos + len(chunk)
     return chunk