Function gnunet_sys::GNUNET_DISK_fn_write[][src]

pub unsafe extern "C" fn GNUNET_DISK_fn_write(
    fn_: *const c_char,
    buf: *const c_void,
    buf_size: usize,
    mode: GNUNET_DISK_AccessPermissions
) -> GNUNET_GenericReturnValue

Write a buffer to a file atomically. The directory is created if necessary. Fail if @a filename already exists or if not exactly @a buf with @a buf_size bytes could be written to @a filename.

@param fn file name @param buf the data to write @param buf_size number of bytes to write from @a buf @param mode file permissions @return #GNUNET_OK on success, #GNUNET_NO if a file existed under @a filename #GNUNET_SYSERR on failure