function.bzwrite.html 5.5 KB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Bin&auml;r-sicheres Schreiben einer bzip2-Datei</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.bzread.html">bzread</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.lzf.html">LZF</a></div>
 <div class="up"><a href="ref.bzip2.html">Bzip2 Funktionen</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.bzwrite" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">bzwrite</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.4, PHP 5)</p><p class="refpurpose"><span class="refname">bzwrite</span> &mdash; <span class="dc-title">Binär-sicheres Schreiben einer bzip2-Datei</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.bzwrite-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><strong>bzwrite</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$bz</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$data</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$length</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>bzwrite()</strong></span> schreibt eine Zeichenkette in den
   übergebenen bzip2-Dateistream.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.bzwrite-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">bz</code></dt>

     <dd>

      <p class="para">
       Der Dateizeiger. Muss gültig sein und auf eine erfolgreich von
       <span class="function"><a href="function.bzopen.html" class="function">bzopen()</a></span> geöffnete Datei zeigen.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">data</code></dt>

     <dd>

      <p class="para">
       Die zu schreibenden Daten.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">length</code></dt>

     <dd>

      <p class="para">
       Wird dieser Parameter übergeben, stoppt das Schreiben nach
       <code class="parameter">length</code> (unkomprimiert) geschriebenen
       Bytes oder wenn alle Bytes aus <code class="parameter">data</code>
       geschrieben wurden, je nachdem, welcher Fall zuerst auftritt.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.bzwrite-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt die Anzahl der geschriebenen Bytes bzw. <strong><code>FALSE</code></strong> im Falle eines
   Fehlers zurück.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.bzwrite-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-617">
    <p><strong>Beispiel #1 <span class="function"><strong>bzwrite()</strong></span>-Beispiel</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$str&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"uncompressed&nbsp;data"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$bz&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">bzopen</span><span style="color: #007700">(</span><span style="color: #DD0000">"/tmp/foo.bz2"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"w"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">bzwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$bz</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$str</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">bzclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$bz</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.bzwrite-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.bzread.html" class="function" rel="rdfs-seeAlso">bzread()</a> - Bin&auml;r-sicheres Lesen aus einer bzip2-Datei</span></li>
    <li class="member"><span class="function"><a href="function.bzopen.html" class="function" rel="rdfs-seeAlso">bzopen()</a> - &Ouml;ffnet eine bzip2-komprimierte Datei</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.bzread.html">bzread</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.lzf.html">LZF</a></div>
 <div class="up"><a href="ref.bzip2.html">Bzip2 Funktionen</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>