public static function readfileChunked($path, $cb, $chunkcb, $pri = EIO_PRI_DEFAULT)
{
$cb = CallbackWrapper::forceWrap($cb);
if (!FileSystem::$supported) {
$chunkcb($path, $r = readfile($path));
$cb($r !== false);
return;
}
FileSystem::open($path, 'r!', function ($file) use($path, $cb, $chunkcb, $pri) {
if (!$file) {
$cb($path, false);
return;
}
$file->readAllChunked($cb, $chunkcb, $pri);
}, null, $pri);
}