Package DebTorrent :: Package BT1 :: Module fakeopen :: Class FakeHandle
[hide private]
[frames] | no frames]

Class FakeHandle

source code

Fake file handles stored in memory.

Instance Methods [hide private]
 
__init__(self, name, fakeopen)
Initialize the instance.
source code
 
flush(self)
Does nothing.
source code
 
close(self)
Does nothing.
source code
 
seek(self, pos)
Seek to a position within the file.
source code
string
read(self, amount=None)
Read data from the file.
source code
 
write(self, s)
Write data to the file.
source code
Instance Variables [hide private]
FakeOpen fakeopen
the collection of all fake files
string name
the file name
int pos
the current position within the file
Method Details [hide private]

__init__(self, name, fakeopen)
(Constructor)

source code 
Initialize the instance.
Parameters:
  • name (string) - the file name
  • fakeopen (FakeOpen) - the collection of all fake files

seek(self, pos)

source code 
Seek to a position within the file.
Parameters:
  • pos (int) - the position to seek to

read(self, amount=None)

source code 
Read data from the file.
Parameters:
  • amount (int) - the amount of data to read
Returns: string
the read data

write(self, s)

source code 
Write data to the file.
Parameters:
  • s (string) - the data to write