def METHOD_NAME(self, pos, mode = 0):
    if self.closed:
        raise ValueError, "I/O operation on closed file"
    if mode == 1:
        pos = pos + self.pos
    elif mode == 2:
        pos = pos + self.len
    self.pos = max(0, pos)