Re: [dev] Question about OOo saving file

2010-11-08 Thread Mathias Bauer

On 03.11.2010 10:31, Lin CHENG wrote:

When OOo saving an existed file, I found ZipOutputStream in package module
write directly the original file. What if OOo or System crash when saving
the existed file. It's impossible to recover the file after OOo or system
restart.

My question is why not write to a temp file at first, then overwriting the
existed file by copying the temp file.


That is exactly what happens when we save a document. But this happens 
outside of the zip code. This is application logic and shouldn't be 
placed into a low level module.


Regards,
Mathias

--
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS
Please don't reply to nospamfor...@gmx.de.
I use it for the OOo lists and only rarely read other mails sent to it.

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



[dev] Question about OOo saving file

2010-11-03 Thread Lin CHENG
When OOo saving an existed file, I found ZipOutputStream in package module
write directly the original file. What if OOo or System crash when saving
the existed file. It's impossible to recover the file after OOo or system
restart.

My question is why not write to a temp file at first, then overwriting the
existed file by copying the temp file.

Best regards!
-- 
Lin CHENG


Re: [dev] Question about OOo saving file

2010-11-03 Thread Andrew Douglas Pitonyak

On 11/03/2010 05:31 AM, Lin CHENG wrote:

When OOo saving an existed file, I found ZipOutputStream in package module
write directly the original file. What if OOo or System crash when saving
the existed file. It's impossible to recover the file after OOo or system
restart.

My question is why not write to a temp file at first, then overwriting the
existed file by copying the temp file.

Best regards!
My guess (note, just a guess) is that it has to do with file permissions 
(and similar issues).


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org