pub unsafe extern "C" fn burn_random_access_write(
d: *mut burn_drive,
byte_address: off_t,
data: *mut c_char,
data_count: off_t,
flag: c_int,
) -> c_intExpand description
Write data in random access mode. The drive must be grabbed successfully before calling this function which circumvents usual libburn session processing and rather writes data without preparations or finalizing. This will work only with overwritable media which are also suitable for burn_write_opts_set_start_byte(). The same address alignment restrictions as with this function apply. I.e. for DVD it is best to align to 32 KiB blocks (= 16 LBA units). The amount of data to be written is subject to the same media dependent alignment rules. Again, 32 KiB is most safe. Call burn_disc_get_multi_caps() can obtain the necessary media info. See resulting struct burn_multi_caps elements .start_adr , .start_alignment , .start_range_low , .start_range_high . Other than burn_disc_write() this is a synchronous call which returns only after the write transaction has ended (successfully or not). So it is wise not to transfer giant amounts of data in a single call. Important: Data have to fit into the already formatted area of the media.
If the burn_drive object is in simulation mode, then no actual write operation or synchronization of the drive buffer will happen. See burn_drive_reset_simulate().
@param d The drive to which to write
@param byte_address The start address of the write in byte (1 LBA unit = 2048 bytes) (do respect media alignment)
@param data The bytes to be written
@param data_count The number of those bytes (do respect media alignment) data_count == 0 is permitted (e.g. to flush the drive buffer without further data transfer).
@param flag Bitfield for control purposes: bit0 = flush the drive buffer after eventual writing
@return 1=successful , <=0 : number of transferred bytes * -1
@since 0.4.0