Skip to main content

svn_io_write_unique

Function svn_io_write_unique 

Source
pub unsafe extern "C" fn svn_io_write_unique(
    tmp_path: *mut *const c_char,
    dirpath: *const c_char,
    buf: *const c_void,
    nbytes: apr_size_t,
    delete_when: svn_io_file_del_t,
    pool: *mut apr_pool_t,
) -> *mut svn_error_t
Expand description

Open a unique file in @a dirpath, and write @a nbytes from @a buf to the file before flushing it to disk and closing it. Return the name of the newly created file in @a *tmp_path, allocated in @a pool.

If @a dirpath is @c NULL, use the path returned from svn_io_temp_dir(). (Note that when using the system-provided temp directory, it may not be possible to atomically rename the resulting file due to cross-device issues.)

The file will be deleted according to @a delete_when.

@since New in 1.6.