Package flumotion :: Package component :: Package misc :: Package httpserver :: Module fileprovider :: Class File
[hide private]

Class File

source code

object --+
         |
        File
Known Subclasses:

I am an asynchronous interface to a file. I can be read and written asynchronously.

Instance Methods [hide private]
str
getMimeType(self)
Returns: the mime type of the file or None if unknown
source code
int
getmtime(self)
Returns: the modification time of the file
source code
long
getsize(self)
Returns: the size of the file
source code
long
tell(self)
Returns: the current read/write position in the file
source code
 
seek(self, offset)
Moves the reading/writing position inside the file.
source code
 
read(self, size)
Reads the specified amount of data asynchronously.
source code
 
close(self)
Close and cleanup the file.
source code
dict
getLogFields(self)
Returns: a dictionary of log fields related to the file usage
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
str mimeType

Inherited from object: __class__

Method Details [hide private]

getMimeType(self)

source code 
Returns: str
the mime type of the file or None if unknown

getmtime(self)

source code 
Returns: int
the modification time of the file

getsize(self)

source code 
Returns: long
the size of the file

tell(self)

source code 
Returns: long
the current read/write position in the file

seek(self, offset)

source code 

Moves the reading/writing position inside the file. Only support absolute offset from file start.

Parameters:
  • offset (long) - the byte offset from the start of the file to go to

read(self, size)

source code 

Reads the specified amount of data asynchronously.

Parameters:
  • size (int) - the amount of byte to read from the file
Returns:
a deferred fired with the read data or a failure. The data can be empty or smaller than the wanted size if the end of file is reached.

getLogFields(self)

source code 
Returns: dict
a dictionary of log fields related to the file usage

Property Details [hide private]

mimeType

Get Method:
getMimeType(self) - Returns: the mime type of the file or None if unknown
Type:
str