K2hash::getQueue K2hash Class K2hash::getSubkeys

K2hash::getStream

Gets a k2hash file stream

Description

 public mixed K2hash::getStream ( string $key , string $mode )

Gets a k2hash file stream.

Parameters

Return Values

Returns a h2hash file stream.

Examples

<?php
K2hash::create("/tmp/test_k2hash.k2h");
$k2hash = new K2hash();
$k2hash->openRW("/tmp/test_k2hash.k2h");
$k2hash->setValue("test1", "value1");
$stream = $k2hash->getStream("test1", "r+");
var_dump(fread($stream, 6));
while (!feof($stream)) {
      if (($buf = fgets($stream, 4096)) !== false) {
           echo $buf;
      }
}
fclose($stream);
$k2hash->close();
?>

The above example will output:

string(6) "value1"
K2hash::getQueue K2hash Class K2hash::getSubkeys