fileslice.py
def write(self, b):
        '''
        Same as `file.write()` but for the slice.
        
        raises:
            EOFError if the new seek position is > `self.size`.
        '''
        if self.closed:
            raise ValueError('I/O operation on closed file.')
        
        if self.pos + len(b) > self.size:
            raise EOFError('new position ({}) will fall outside the file slice range (0-{})'.format(self.pos + len(b), self.size))
        
        with self.lock:
            self.f.seek(self.start + self.pos)
            result = self.f.write(b)
            self.seek(self.pos + len(b))
        
        return result
def write(self, b):
        '''
        Same as `file.write()` but for the slice.
        
        raises:
            EOFError if the new seek position is > `self.size`.
        '''
        if self.closed:
            raise ValueError('I/O operation on closed file.')
        
        if self.pos + len(b) > self.size:
            raise EOFError('new position ({}) will fall outside the file slice range (0-{})'.format(self.pos + len(b), self.size))
        
        with self.lock:
            self.f.seek(self.start + self.pos)
            result = self.f.write(b)
            self.seek(self.pos + len(b))
        
        return result
Same as `file.write()` but for the slice.
        
        raises:
            EOFError if the new seek position is > `self.size`.