def read(self, offset, length):
readfile = getattr(self, '<STR_LIT>', None)<EOL>if readfile is None:<EOL><INDENT>return SFTP_OP_UNSUPPORTED<EOL><DEDENT>try:<EOL><INDENT>if self.__tell is None:<EOL><INDENT>self.__tell = readfile.tell()<EOL><DEDENT>if offset != self.__tell:<EOL><INDENT>readfile.seek(offset)<EOL>self.__tell = offset<EOL><DEDENT>data = readfile.read(length)<EOL><DEDENT>except IOError as e:<EOL><INDENT>self.__tell = None<EOL>return SFTPServer.convert_errno(e.errno)<EOL><DEDENT>self.__tell += len(data)<EOL>return data<EOL>
Read up to C{length} bytes from this file, starting at position
C{offset}.  The offset may be a python long, since SFTP allows it
to be 64 bits.

If the end of the file has been reached, this method may return an
empty string to signify EOF, or it may also return L{SFTP_EOF}.

The default implementation checks for an attribute on C{self} named
C{readfile}, and if present, performs the read operation on the python
file-like object found there.  (This is meant as a time saver for the
common case where you are wrapping a python file object.)

@param offset: position in the file to start reading from.
@type offset: int or long
@param length: number of bytes to attempt to read.
@type length: int
@return: data read from the file, or an SFTP error code.
@rtype: str