https://bz.apache.org/ooo/show_bug.cgi?id=126869

--- Comment #45 from Arrigo Marchiori <[email protected]> ---
(In reply to Peter from comment #42)
> related to comment 38: In line 1858 is maybe a trick to confirm if the file
> is really write able? 

I think it's quite possible!

Or, alternatively, the "overwrite" parameter is not "trusted".
In fact, output data is copied by calling:

   aOriginalContent.writeStream(aTempInput, bOverWrite);

where bOverWrite is true when saving and false when "saving as". 
Setting it to true it's useless, if the file was already truncated.

> I find it unlucky to abort the writing. Maybe it would
> be more clear to write a stream of one character.
> And honest to ensure that the file is write able Is imho here is a wrong
> place.
> We do not want to worry here if the file is write able or not.

Well, there is an interesting detail.

Before the truncation, variable bTransactStarted is set to true.
If the truncation fails, then probably an exception will be raised and caught
below.
Then, the file will be restored from the backup.
But if the truncation failed, then restoring from the backup is also likely to
fail...

Maybe it is not a check for write access, but rather a way to make sure the
contents are overwritten and not appended?

> I think the code mixes a lot of layers.

I agree.

-- 
You are receiving this mail because:
You are the assignee for the issue.

Reply via email to