<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.streamwrapper.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'streamwrapper.stream-seek.php',
    1 => 'streamWrapper::stream_seek',
    2 => 'ストリーム内の特定の場所に移動する',
  ),
  'up' => 
  array (
    0 => 'class.streamwrapper.php',
    1 => 'streamWrapper',
  ),
  'prev' => 
  array (
    0 => 'streamwrapper.stream-read.php',
    1 => 'streamWrapper::stream_read',
  ),
  'next' => 
  array (
    0 => 'streamwrapper.stream-set-option.php',
    1 => 'streamWrapper::stream_set_option',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/stream/streamwrapper/stream-seek.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="streamwrapper.stream-seek" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">streamWrapper::stream_seek</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.2, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">streamWrapper::stream_seek</span> &mdash; <span class="dc-title">ストリーム内の特定の場所に移動する</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-streamwrapper.stream-seek-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>streamWrapper::stream_seek</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$offset</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$whence</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   このメソッドは、<span class="function"><a href="function.fseek.php" class="function">fseek()</a></span> に対応してコールされます。
  </p>
  <p class="para">
   ストリームの読み込み/書き込み位置を、
   <code class="parameter">offset</code> と <code class="parameter">whence</code>
   に応じて更新しなければなりません。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-streamwrapper.stream-seek-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">offset</code></dt>
     <dd>
      <p class="para">
       移動するストリームオフセット。
      </p>
     </dd>
    
    
     <dt><code class="parameter">whence</code></dt>
     <dd>
      <p class="para">
       使用可能な値
       <ul class="simplelist">
        <li><strong><code><a href="filesystem.constants.php#constant.seek-set">SEEK_SET</a></code></strong> - <code class="parameter">offset</code> バイト目の位置に移動する。</li>
        <li><strong><code><a href="filesystem.constants.php#constant.seek-cur">SEEK_CUR</a></code></strong> - 現在位置から <code class="parameter">offset</code> バイトぶん進める。</li>
        <li><strong><code><a href="filesystem.constants.php#constant.seek-end">SEEK_END</a></code></strong> - ファイルの終端から <code class="parameter">offset</code> バイトぶん進める。</li>
       </ul>
      </p>
      <blockquote class="note"><p><strong class="note">注意</strong>: 
       <span class="simpara">
        現在の実装は、
        <code class="parameter">whence</code> の値を <strong><code><a href="filesystem.constants.php#constant.seek-cur">SEEK_CUR</a></code></strong> に設定することはありません。
        そのようなシークは、
        内部的に <strong><code><a href="filesystem.constants.php#constant.seek-set">SEEK_SET</a></code></strong> と同じ動きに変換されます。
       </span>
      </p></blockquote>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-streamwrapper.stream-seek-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   位置を更新した場合に <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>、それ以外の場合に <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します。
  </p>
 </div>




 <div class="refsect1 notes" id="refsect1-streamwrapper.stream-seek-notes">
  <h3 class="title">注意</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    実装されていないの戻り値は <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> とみなされます。
   </p>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    成功した場合、
    <span class="methodname"><strong>streamWrapper::stream_seek()</strong></span> をコールした直後に
    <span class="methodname"><a href="streamwrapper.stream-tell.php" class="methodname">streamWrapper::stream_tell()</a></span> がコールされます。
    <span class="methodname"><a href="streamwrapper.stream-tell.php" class="methodname">streamWrapper::stream_tell()</a></span> が失敗すると、
    呼び出し元関数への戻り値は <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> に設定されます。
   </p>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    ストリーム上でシーク操作をしたときに、必ずこの関数がコールされるとは限りません。
    PHP のストリームはバッファ付きの読み込みがデフォルトで有効になっている
    (<span class="function"><a href="function.stream-set-read-buffer.php" class="function">stream_set_read_buffer()</a></span> も参照ください)
    ので、シーク操作が単なるバッファポインタの移動だけで済む場合があります。
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-streamwrapper.stream-seek-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.fseek.php" class="function" rel="rdfs-seeAlso">fseek()</a> - ファイルポインタを移動する</span></li>
   </ul>
  </p>
 </div>


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