[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: branch 0.35.0: All my "make tests" are ok, how about you? ;-)

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-12-17 20:13:59 CET

Erik Huelsmann wrote:

>>Just goes to show, we _must_ close files when we're done with them, like
>>I said.
>>
>>
>
>BTW: you're looking at the code I am going to ask a function change for in
>APR. I thought to do that after 1.0; since there is only one instance we do
>this within Subversion I didn't think we have a very hard case.
>
>The thing is: we want a temporary file to be upgraded to a permanent one,
>but only after we reach a certain state. Therefore I was going to create the
>file with the APR_DELONCLOSE flag. After we reach the state we want to be in,
>we clear the APR_DELONCLOSE flag and close the file. It has been upgraded to a
>permanent one. If we don't reach the state we want to be in, we don't clear
>the flag and APR closes and deletes the file for us.
>
>This is all possible with the current APR implementation except for the
>Win32 one: it uses the (unclearable) system flag to create this behaviour,
>whereas all other implementations use one built into APR.
>
>

You don't need an API change for that, let alone a change in the
implementatino of the APR_DELONCLOSE flag. What you propose is in the
same category as trying to change the open mode from readonly to
readwrite without closing the file first.

Instead of using APR_DELONCLOSE, you can register a pool cleanup that
does the same thing, then remove it later if you've changed your mind.
APR gives you all the mechanisms you need.

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Dec 17 20:17:52 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.