Issue 22745

Summary: XSimpleFileAccess::openFileWrite() not truncating
Product: ucb Reporter: em2 <em-ooo>
Component: codeAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: OOo 1.1   
Target Milestone: AOO PleaseHelp   
Hardware: PC   
OS: Linux, all   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description em2 2003-11-22 22:28:24 UTC
(There's no "documentation" subcomponent for "ucb"...)

It is not documented that XSimpleFileAccess::openFileWrite()
does not truncate the file.

There's no API which atomically opens and truncates a file
(using kill() has race conditions and can be desastrous for
directories).
Comment 1 matthias.huetsch 2003-11-23 14:11:40 UTC
Yes, I agree that this is at least a documentation issue (if not even a
request for an improved implementation).
Comment 2 matthias.huetsch 2003-11-23 14:13:12 UTC
Hi Andreas,

can you please have a look into this (and at least improve the
documentation, if not the implementation)?

Thanks,
Matthias
Comment 3 ab 2003-11-27 12:11:41 UTC
AB: Accepted as documentation issue. I think the implementation 
must not be changed, because code may already rely on the current
behaviour. Besides, the statement "There's no API which atomically 
opens truncates a file" is not true. Everyone is free to use UCB
API directly. The SimpleFileAccess service is - as its name says -
only a simple wrapper for convenience.
Comment 4 em2 2003-11-27 13:43:15 UTC
So, everyone who wants to create/truncate a file has
to reinvent the wheel? If that's the policy, why have
XSimpleFileAccess in the first place?

Using the UCB for such a simple operation as
creating/truncating a file is overkill -- it's much simpler
to wrap a C FILE in an XOutputStream.

Why not add createTruncateFile() to, say, XSimpleFileAccess4?
Comment 5 b.osi.ooo 2004-05-18 14:59:29 UTC
According to the roadmap of  OpenOffice.org 2.0
(http://tools.openoffice.org/releases/q-concept.html) this
issue has been scheduled for 3.0. 
Comment 6 christof.pintaske 2004-06-16 13:11:14 UTC
s. above
Comment 7 christof.pintaske 2004-06-17 17:05:16 UTC
cp: retargeted to Office-Later due to limited ressources
Comment 8 Marcus 2017-05-20 11:29:36 UTC
Reset assigne to the default "issues@openoffice.apache.org".