apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmpil...@collab.net
Subject Re: [time to move on I guess] APR_TMP_DIRECTORY
Date Mon, 09 Dec 2002 16:01:43 GMT
Dirk-Willem van Gulik <dirkx@webweaving.org> writes:

> On 9 Dec 2002 cmpilato@collab.net wrote:
> 
> > Wow...  so our 'svnlook' utility needs to grow config file support or
> > some unwieldy --with-tmp cmdline argument just because the portability
> > layer doesn't want to answer a single portability question.
> 
> As you cannot use tmp file (handles) ?

Correct.  In this one of several uses of tmpfiles in Subversion and
its utilities, svnlook needs to create two temporary files to be used
by an external 'diff' process.  Given only handles, we have no paths
to provide to that 'diff' process.  CVS gets around this by using an
internal diff library -- no such BSD-compatible thing exists that we
know of, though Sander Striker has been working off and on at writing
one from scratch.

Another use of temp files is with user's log messages.  You know how
CVS will, if a commit fails, keep your log message around in a
temporary file, and tell you something like "Hey, your commit failed,
but that log message you spent 10 minutes composing is over here in
/tmp/cvs121234.tmp".  Subversion is doing the same thing.  When your
$EDITOR pops up so you can compose your log message, it needs a
temporary file to act on.  Again, a handle alone can't be provided on
the commandline to your $EDITOR.  Even if we could pass a handle to
the editor, after you close your editor, we *don't* want that tempfile
to disappear, because we have to read that file back in to use as part
of the commit process.  And we want the file to persist until we have
a chance to clean it up.

Now, most of Subversion's operations require a working copy, so we
make our tempfiles in the .svn/tmp/ directory in those cases.  But we
have several commands that act directly on the repository all the way
across the network, with no working copy (and therefore no guaranteed
user-writable place to put tempfiles).

Mime
View raw message