Public Member Functions | |
| GenieGate_TempWriter ($filename) | |
| constructor, this creates the object. | |
| getFilename () | |
| Get the filename. | |
| getRead () | |
| Get the read handle. | |
| getWrite () | |
| Get the write handle. | |
| cancel () | |
| Attempts to "cancel" the operation. | |
| isCanceled () | |
| Return TRUE if the operation has been cancelled. | |
| complete () | |
| Call this method when finished editing. | |
The idea is to perform an edit with some type "cancel" function, and an attempt to recover from errors.
The basic idea is: open read file. lock read file. create temp file (for writing to)
read + write data ( getWrite() , getRead() )
call complete() complete will rename the read file to a backup file, attempt to rename the temp file to the original file, unlink the backup file.
NOTE: this implementation doesn't rename the original file until after all editing is done, so that existing processes can read the file while we're working on it.
Definition at line 29 of file utils.php.
|
|
constructor, this creates the object. If the filename does not exist, it will be created.
Definition at line 46 of file utils.php. References cancel(). |
|
|
Attempts to "cancel" the operation. This will close the file handles, unlock and remove temp data. Data will not be saved. Definition at line 92 of file utils.php. Referenced by GenieGate_TempWriter(). |
|
|
Call this method when finished editing. It attempts to move the data from the write handle to the reader, with some primitive error recovery. Definition at line 125 of file utils.php. References isCanceled(). |
|
|
Get the read handle.
|
|
|
Get the write handle.
|
Documentation generated by DoxyGen