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

Re: svn commit: r33826 - in trunk/subversion: include libsvn_fs_fs libsvn_subr libsvn_wc

From: Greg Stein <gstein_at_gmail.com>
Date: Tue, 21 Oct 2008 14:33:06 -0700

On Tue, Oct 21, 2008 at 1:16 PM, <hwright_at_tigris.org> wrote:
>...
\> +++ trunk/subversion/include/svn_io.h Tue Oct 21 13:16:27 2008
    (r33826)
> @@ -1391,6 +1391,22 @@ svn_io_file_write_full(apr_file_t *file,
> apr_size_t *bytes_written,
> apr_pool_t *pool);
>
> +/**
> + * Open a unique file in @a dirpath, and write @a nbytes from @a buf to
> + * the file before closing it. If @a tmp_path is not @c NULL, return the
> + * name of the newly created file in @a *tmp_path, allocated in @a pool.

What?! Okay... so let's see. If tmp_path *IS* NULL, then I won't know
where it put my data. Did I get that right?

:-P

> +++ trunk/subversion/libsvn_subr/io.c Tue Oct 21 13:16:27 2008 (r33826)
> @@ -2719,6 +2719,24 @@ svn_io_file_write_full(apr_file_t *file,
>
>
> svn_error_t *
> +svn_io_write_unique(const char **tmp_path,
> + const char *dirpath,
> + const void *buf,
> + apr_size_t nbytes,
> + svn_io_file_del_t delete_when,
> + apr_pool_t *pool)
> +{
> + apr_file_t *new_file;
> +
> + SVN_ERR(svn_io_open_unique_file2(&new_file, tmp_path, dirpath, ".tmp",
> + delete_when, pool));
> + SVN_ERR(svn_io_file_write_full(new_file, buf, nbytes, NULL, pool));
> + SVN_ERR(svn_io_file_flush_to_disk(new_file, pool));
> + return svn_io_file_close(new_file, pool);

Why the flush? You close the file on the next line. By definition, all
writes will be flushed.

Cheers,
-g

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-10-21 23:33:14 CEST

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.