Ales Kahanek wrote: > With such applications we do another approach: we try periodically to > get ShareExclusive access to this file. If the request is rejected, we > know that the file is still opened and edited. And here is the problem > with Writer - when you save the file in Writer, there is a short period > of time, when the the exclusive access to the file can be obtained and > more, the file can be even DELETED. There is an important point to know: > this behaviour can be reproduced when the OO QuickStarter is running (I > do not know if this could have any impact on it).
> What do you think about it? How can I know, when the file opened by > Writer was closed? Or better - shouldn�t this behaviour be changed not > to release the file access "lock"? If we overwrite a file we must (at least for a short span of time) release the old one or (to keep the lock) use a more complicated approach that - when things go haywire - can result in crashes and data loss or would need a complete rewrite of our persistence code to avoid that. It's too much to explain it here but believe me, we considered this very carefully. There are so many things that can happen why saving a file, you wouldn't believe it. And Linux/Unix file systems add a lot of complexity that make them incomparable with Windows file systems, so a comparison with Word or Excel doesn't really help. BTW: we changed the behavior a bit for OOo2.0 (but still with a temporary release) and now we have the most robust solution implemented, Even removing a remote file system while a file gets saved to it shouldn't cause OOo to crash or lose data. Relying on the "locked" state of a file IMHO is a hack (sorry). But there's no need to use such a hack because you can use our API to get the job done. If you placed a listener in every open document you would get notifications when they are closed and then copy the content of the file they have been saved to to your database. Best regards, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
