Function physfs_sys::PHYSFS_writeBytes[][src]

pub unsafe extern "C" fn PHYSFS_writeBytes(
    handle: *mut PHYSFS_File,
    buffer: *const c_void,
    len: PHYSFS_uint64
) -> PHYSFS_sint64
Expand description

\fn PHYSFS_sint64 PHYSFS_writeBytes(PHYSFS_File *handle, const void *buffer, PHYSFS_uint64 len) \brief Write data to a PhysicsFS filehandle

The file must be opened for writing.

Please note that while (len) is an unsigned 64-bit integer, you are limited to 63 bits (9223372036854775807 bytes), so we can return a negative value on error. If length is greater than 0x7FFFFFFFFFFFFFFF, this function will immediately fail. For systems without a 64-bit datatype, you are limited to 31 bits (0x7FFFFFFF, or 2147483647 bytes). We trust most things won’t need to do multiple gigabytes of i/o in one call anyhow, but why limit things?

\param handle retval from PHYSFS_openWrite() or PHYSFS_openAppend(). \param buffer buffer of (len) bytes to write to (handle). \param len number of bytes being written to (handle). \return number of bytes written. This may be less than (len); in the case of an error, the system may try to write as many bytes as possible, so an incomplete write might occur. PHYSFS_getLastErrorCode() can shed light on the reason this might be < (len). -1 if complete failure.