k2hpx_da_set_read_offset
Sets the offset to read the data
Description
int k2hpx_da_set_read_offset ( mixed $dahandle_res , int $offset )
Sets the offset to read the data.
Note
The k2hash direct access handle is a handler to provide quick access to the specific part of large data using offset.
Parameters
- dahandle_res
Specifies the k2hash direct access file handle that k2hpx_da_get_handle returns. - offset
Specifies the offset to read the data.
Return Values
Returns true on success or false on failure.
Examples
- Example 1 - Sets the offset to read the data
<?php
$handle = k2hpx_open_mem();
k2hpx_set_value($handle, "test", "value");
$dahandle = k2hpx_da_get_handle_rw($handle, "test");
var_dump(k2hpx_da_get_offset($dahandle));
var_dump(k2hpx_da_set_read_offset($dahandle, 5));
var_dump(k2hpx_da_get_offset($dahandle));
k2hpx_da_free($dahandle);
k2hpx_close($handle);
?>
The above example will output:
array(2) {
[0]=>
int(0)
[1]=>
int(0)
}
bool(true)
array(2) {
[0]=>
int(5)
[1]=>
int(0)
}
See Also
- k2hpx_da_free - Frees resources of k2hash direct access handle
- k2hpx_da_get_handle_read - Reads data
- k2hpx_da_get_handle_rw - Gets the k2h direct access file handle with read-write only mode
- k2hpx_da_get_handle_write - Gets the k2h direct access file handle with write only mode
- k2hpx_da_get_handle - Gets the k2h direct access file handle
- k2hpx_da_get_length - Gets the data length
- k2hpx_da_get_offset - Gets the k2h direct access file offset with read-write access mode
- k2hpx_da_get_read_offset - Gets the k2h direct access file offset with read access mode
- k2hpx_da_get_value_to_file - Reads value using the offset and write it to the file
- k2hpx_da_get_value - Reads value using the offset
- k2hpx_da_get_write_offset - Gets the k2h direct access file offset with write access mode
- k2hpx_da_set_offset - Sets the offset to modify the data
- k2hpx_da_set_value_from_file - Sets value using the offset reading data from the file with length
- k2hpx_da_set_value - Sets value
- k2hpx_da_set_write_offset - Sets value using the offset