Hi Niklas,

On Tuesday 09 January 2007 20:52, Niklas Nebel wrote:

> >> Besides that I don't think that something must be changed in osl. We
> >> just have to change our way how we interpret the results from openFile.
> >
> > Unfortunately it must be.  I don't want to open the file again, I just
> > want to set/clear the lock, and there's no API for that in osl.
>
> Why not open it again?

Sorry for the confusion, I should have been more verbose.  The file has to be 
locked between loading the document from disk (for the merge) and the actual 
saving.  We cannot close and open it again, because the other instance could 
write in the meantime (however short) which would potentially lead to data 
loss.

> Treat it more like import/export instead of 
> load/save, with embedded objects in a temporary storage, and don't keep
> a file handle. Then, before saving, check if your "shared" file is still
> there (you'll have to read it anyway, for the intermediate changes).

Here we should lock just before the check, and release the lock after the 
saving; otherwise again, anything can happen between the check and the save.

Or maybe I did not understand you correctly?

Thank you,
Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to