<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.zlib.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.gzseek.php',
    1 => 'gzseek',
    2 => 'Positioniert den gz-Dateizeiger',
  ),
  'up' => 
  array (
    0 => 'ref.zlib.php',
    1 => 'Zlib-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.gzrewind.php',
    1 => 'gzrewind',
  ),
  'next' => 
  array (
    0 => 'function.gztell.php',
    1 => 'gztell',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/zlib/functions/gzseek.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.gzseek" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gzseek</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">gzseek</span> &mdash; <span class="dc-title">Positioniert den gz-Dateizeiger</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.gzseek-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gzseek</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$stream</code></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 class="initializer"> = <strong><code><a href="filesystem.constants.php#constant.seek-set">SEEK_SET</a></code></strong></span></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   Setzt die Schreib-/Leseposition für die angegebene Datei.
   Dies entspricht dem C-API Aufruf
   <code class="literal">gzseek(zp, offset, SEEK_SET)</code>.
  </p>
  <p class="para">
   Wenn die Datei für Lesezugriffe geöffnet ist, wird diese Funktion
   emuliert und kann sehr langsam sein. Wenn die Datei zum Schreiben
   geöffnet ist, kann nur vorwärts positioniert werden; die Funktion
   komprimiert dann eine Sequenz von Nullbytes, um die gewünschte
   Position zu erreichen.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.gzseek-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">stream</code></dt>
     <dd>
      <p class="para">
       Der gz-Dateizeiger. Dieser muss auf eine gültige, erfolgreich mit
       <span class="function"><a href="function.gzopen.php" class="function">gzopen()</a></span> geöffnete Datei zeigen.
      </p>
     </dd>
    
    
     <dt><code class="parameter">offset</code></dt>
     <dd>
      <p class="para">
       Die gewünschte Position.
      </p>
     </dd>
    
    
     <dt><code class="parameter">whence</code></dt>
      <dd>
       <p class="para">
        <code class="parameter">whence</code> gibt an, auf welche Anfangsposition sich
        <code class="parameter">offset</code> bezieht. Mögliche Werte sind:
        <ul class="simplelist">
         <li><strong><code><a href="filesystem.constants.php#constant.seek-set">SEEK_SET</a></code></strong> - Setzt die Position auf <code class="parameter">offset</code> Bytes vom Dataianfang.</li>
         <li><strong><code><a href="filesystem.constants.php#constant.seek-cur">SEEK_CUR</a></code></strong> - Verschiebt die Position um <code class="parameter">offset</code> Bytes ausgehend von der aktuellen Position.</li>
        </ul>
       </p>
       <p class="para">
        Wird <code class="parameter">whence</code> nicht angegeben, so wird
        <strong><code><a href="filesystem.constants.php#constant.seek-set">SEEK_SET</a></code></strong> angenommen.
       </p>
      </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.gzseek-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt 0 bei Erfolg und -1 bei Fehlern zurück. Beachten Sie, dass eine Suche
   über das Dateiende hinaus nicht als Fehler gilt.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.gzseek-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>gzseek()</strong></span>-Beispiel</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$gz </span><span style="color: #007700">= </span><span style="color: #0000BB">gzopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'somefile.gz'</span><span style="color: #007700">, </span><span style="color: #DD0000">'r'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">gzseek</span><span style="color: #007700">(</span><span style="color: #0000BB">$gz</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">gzgetc</span><span style="color: #007700">(</span><span style="color: #0000BB">$gz</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">gzclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$gz</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.gzseek-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.gztell.php" class="function" rel="rdfs-seeAlso">gztell()</a> - Ermittelt die aktuelle Position eines gz-Dateizeigers</span></li>
    <li><span class="function"><a href="function.gzrewind.php" class="function" rel="rdfs-seeAlso">gzrewind()</a> - Setzt den gz-Dateizeiger auf den Anfang zur&uuml;ck</span></li>
   </ul>
  </p>
 </div>

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