Package gofer :: Module pmon :: Class File
[hide private]
[frames] | no frames]

Class File

source code

Safe file operations.

Instance Methods [hide private]
 
__init__(self, path) source code
 
open(self)
Open (if not already open)
source code
 
close(self)
Close (if not already closed)
source code
buffer
read(self, n)
Read (n) bytes.
source code
int
mtime(self)
Get modification time.
source code
str
digest(self)
Get the SHA256 hex digest for content.
source code
 
__del__(self) source code
Instance Variables [hide private]
fileobj fp
The python file object.
str path
The path.
Method Details [hide private]

__init__(self, path)
(Constructor)

source code 
Parameters:
  • path (str) - The file path.

read(self, n)

source code 

Read (n) bytes.

Parameters:
  • n (int) - The bytes to read.
Returns: buffer
the bytes read.

mtime(self)

source code 

Get modification time.

Returns: int
mtime

digest(self)

source code 

Get the SHA256 hex digest for content.

Returns: str
the hexdigest.