class documentation

class InMemoryRemoteFile(BytesIO): (source)

Implements interfaces: twisted.conch.interfaces.ISFTPFile

View In Hierarchy

An ISFTPFile which handles all data in memory.

Method __init__ No summary
Method close No summary
Method getAttrs Return the attributes for the file.
Method getvalue Get current data of file.
Method readChunk Read from the file.
Method setAttrs Set the attributes for the file.
Method writeChunk No summary
Instance Variable name Undocumented
Instance Variable _closed Undocumented
def __init__(self, name): (source)
Parameters
name:strName of this file.
def close(self): (source)
See Also

ISFTPFile.writeChunk

Keeps data after file was closed to help with testing.

def getAttrs(self): (source)

Return the attributes for the file.

This method returns a dictionary in the same format as the attrs argument to openFile or a Deferred that is called back with same.

def getvalue(self): (source)

Get current data of file.

Allow reading data event when file is closed.

def readChunk(self, offset, length): (source)

Read from the file.

If EOF is reached before any data is read, raise EOFError.

This method returns the data as a string, or a Deferred that is called back with same.

Parameters
offsetan integer that is the index to start from in the file.
lengththe maximum length of data to return. The actual amount returned may less than this. For normal disk files, however, this should read the requested number (up to the end of the file).
def setAttrs(self, attrs): (source)

Set the attributes for the file.

This method returns when the attributes are set or a Deferred that is called back when they are.

Parameters
attrsa dictionary in the same format as the attrs argument to openFile.
def writeChunk(self, start, data): (source)

Undocumented

Undocumented