Package trac :: Package util :: Class AtomicFile

Class AtomicFile

source code

object --+
         |
        AtomicFile

A file that appears atomically with its full content.

This file-like object writes to a temporary file in the same directory as the final file. If the file is committed, the temporary file is renamed atomically (on Unix, at least) to its final name. If it is rolled back, the temporary file is removed.

Instance Methods
 
__init__(self, path, mode='w', bufsize=-1)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__getattr__(self, name) source code
 
commit(self) source code
 
rollback(self) source code
 
close(self) source code
 
__del__(self) source code
 
__enter__(self) source code
 
__exit__(self, exc_type, exc_value, traceback) source code

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

Properties
  closed

Inherited from object: __class__

Method Details

__init__(self, path, mode='w', bufsize=-1)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

Property Details

closed

Get Method:
unreachable(self)