[Pmwiki-users] Edit / Lock Pages

Patrick R. Michaud pmichaud
Tue Jan 27 13:36:41 CST 2004


On Tue, Jan 27, 2004 at 09:30:05PM +0100, Christian Ridderstr?m wrote:
> On Tue, 27 Jan 2004, Jonathan Scott Duff wrote:
> 
> * The edit page/form get's a hidden field with the lastest time the page's 
>   file was modified (mtime).
> * When the new page source is submitted, the stored mtime is compared 
>   to the current mtime
> ** If the mtimes are identical, it's safe to write the changes.
>    If the current modification time has increased, someone else has 
>    modified the page and you may have a conflict.

Yes, this part is easy--it's conflict detection.  The real question is, 
what should happen once a conflict has been detected?

> Note: A file lock is probably needed just before writing the changes, i.e. 
> to make sure that someone else doesn't manage to write in the small amount 
> of time between getting the mtime and starting to write :-)

PmWiki already does file locking to make sure this doesn't happen--
this is the purpose of the .flock file.

Pm



More information about the pmwiki-users mailing list