<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.eio.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.eio-sync-file-range.php',
    1 => 'eio_sync_file_range',
    2 => 'Sync a file segment with disk',
  ),
  'up' => 
  array (
    0 => 'ref.eio.php',
    1 => 'Eio 函数',
  ),
  'prev' => 
  array (
    0 => 'function.eio-sync.php',
    1 => 'eio_sync',
  ),
  'next' => 
  array (
    0 => 'function.eio-syncfs.php',
    1 => 'eio_syncfs',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/eio/functions/eio-sync-file-range.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.eio-sync-file-range" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">eio_sync_file_range</h1>
  <p class="verinfo">(PECL eio &gt;= 0.0.1dev)</p><p class="refpurpose"><span class="refname">eio_sync_file_range</span> &mdash; <span class="dc-title">Sync a file segment with disk</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.eio-sync-file-range-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>eio_sync_file_range</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$fd</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$offset</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$nbytes</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$flags</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$pri</code><span class="initializer"> = EIO_PRI_DEFAULT</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$callback</code><span class="initializer"> = NULL</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$data</code><span class="initializer"> = NULL</span></span><br>): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>

  <p class="simpara">
   <span class="function"><strong>eio_sync_file_range()</strong></span> permits fine control when synchronizing the open file referred to by the file
 descriptor <code class="parameter">fd</code> with disk.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.eio-sync-file-range-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt><code class="parameter">fd</code></dt>
    <dd>
     <span class="simpara">
     File descriptor
     </span>
    </dd>
   
   
    <dt><code class="parameter">offset</code></dt>
    <dd>
     <span class="simpara">
     The starting byte of the file range to be synchronized
     </span>
    </dd>
   
   
    <dt><code class="parameter">nbytes</code></dt>
    <dd>
     <span class="simpara">
     Specifies the length of the range to be synchronized, in bytes. If
     <code class="parameter">nbytes</code> is zero, then all bytes from <code class="parameter">offset</code> through
     to the end of file are synchronized.
     </span>
    </dd>
   
   
    <dt><code class="parameter">flags</code></dt>
    <dd>
     <span class="simpara">
     A bit-mask. Can include any of the following values:
     <strong><code><a href="eio.constants.php#constant.eio-sync-file-range-wait-before">EIO_SYNC_FILE_RANGE_WAIT_BEFORE</a></code></strong>,
     <strong><code><a href="eio.constants.php#constant.eio-sync-file-range-write">EIO_SYNC_FILE_RANGE_WRITE</a></code></strong>,
     <strong><code><a href="eio.constants.php#constant.eio-sync-file-range-wait-after">EIO_SYNC_FILE_RANGE_WAIT_AFTER</a></code></strong>. These flags have
     the same meaning as their <em>SYNC_FILE_RANGE_*</em>
     counterparts(see <code class="literal">SYNC_FILE_RANGE(2)</code> man page).
     </span>
    </dd>
   
   
    <dt><code class="parameter">pri</code></dt>
    <dd>
    <p class="para">请求的优先级：<strong><code><a href="eio.constants.php#constant.eio-pri-default">EIO_PRI_DEFAULT</a></code></strong>，<strong><code><a href="eio.constants.php#constant.eio-pri-min">EIO_PRI_MIN</a></code></strong>，<strong><code><a href="eio.constants.php#constant.eio-pri-max">EIO_PRI_MAX</a></code></strong> 或 <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>。如果是
<strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>，<code class="parameter">pri</code> 将设为
<strong><code><a href="eio.constants.php#constant.eio-pri-default">EIO_PRI_DEFAULT</a></code></strong>。
</p>

    </dd>
   
   
    <dt><code class="parameter">callback</code></dt>
    <dd>
     <p class="para">
<code class="parameter">callback</code>
函数在请求完成时被调用。其应匹配一下原型：<div class="example-contents"><div class="phpcode"><code><span style="color: #000000">void callback(mixed $data, int $result[, resource $req]);</span></code></div></div>

<dl>
 
  <dt><code class="parameter">data</code></dt>
  <dd><p class="para">传递给请求的用户数据。</p></dd>
 
 
  <dt><code class="parameter">result</code></dt>
  <dd><p class="para">针对请求的结果的值。通常是相应的系统调用返回的值。</p></dd>
 
 
  <dt><code class="parameter">req</code></dt>
  <dd><p class="para">可选的请求资源，可被 <span class="function"><a href="function.eio-get-last-error.php" class="function">eio_get_last_error()</a></span>
   之类的函数使用。</p></dd>
 
</dl>
</p>

    </dd>
   
   
    <dt><code class="parameter">data</code></dt>
    <dd>
     <span class="simpara">
     Arbitrary variable passed to <code class="parameter">callback</code>.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.eio-sync-file-range-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="simpara">
   <span class="function"><strong>eio_sync_file_range()</strong></span> returns request resource on success, 或者在失败时返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
  </p>
 </div>


</div><?php manual_footer($setup); ?>