Trees | Index | Help |
|
---|
Package logilab :: Package common :: Module fileutils :: Class ProtectedFile |
|
object
--+ |file
--+ | ProtectedFile
a special file-object class that automatically that automatically does a 'chmod +w' when needed
XXX: for now, the way it is done allows 'normal file-objects' to be created during the ProtectedFile object lifetime. One way to circumvent this would be to chmod / unchmod on each write operation.
One other way would be to :
Method Summary | |
---|---|
__init__(self,
filepath,
mode)
| |
__del__(self)
| |
restore mode before closing | |
Inherited from file | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__iter__() <==> iter(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
integer "file descriptor" |
This is needed for lower-level file interfaces, such os.read(). |
None |
flush() -> None. |
true or false |
isatty() -> true or false. |
x.next() -> the next value, or raise StopIteration | |
read at most size bytes, returned as a string |
If the size argument is negative or omitted, read until EOF is reached. |
Undocumented |
readinto() -> Undocumented. |
next line from the file, as a string |
Retain newline. |
list of strings, each a line from the file |
Call readline() repeatedly and return a list of the lines so read. |
None |
Argument offset is a byte count. |
current file position, an integer (may be a long integer). |
tell() -> current file position, an integer (may be a long integer). |
None |
Size defaults to the current file position, as returned by tell(). |
None |
Note that due to buffering, flush() or close() may be needed before the file on disk reflects the data written. |
None |
Note that newlines are not added. |
returns self |
For backward compatibility. |
Inherited from object | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__str__() <==> str(x) |
Class Variable Summary | |
---|---|
Inherited from file | |
getset_descriptor |
closed = <attribute 'closed' of 'file' objects>
|
member_descriptor |
encoding = <member 'encoding' of 'file' objects>
|
member_descriptor |
mode = <member 'mode' of 'file' objects>
|
member_descriptor |
name = <member 'name' of 'file' objects>
|
getset_descriptor |
newlines = <attribute 'newlines' of 'file' objects>
|
member_descriptor |
softspace = <member 'softspace' of 'file' objects>
|
Method Details |
---|
close(self)restore mode before closing
|
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Apr 14 11:37:32 2005 | http://epydoc.sf.net |