<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.dio.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.dio-open.php',
    1 => 'dio_open',
    2 => '&Ouml;ffnet eine Datei (falls n&ouml;tig, wird diese erzeugt) auf einem niedrigeren
   Level als es die C-Bibliotheks Ein-/Ausgabe-Stream-Funktionen erlauben',
  ),
  'up' => 
  array (
    0 => 'ref.dio.php',
    1 => 'Direct-IO-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.dio-fcntl.php',
    1 => 'dio_fcntl',
  ),
  'next' => 
  array (
    0 => 'function.dio-read.php',
    1 => 'dio_read',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/dio/functions/dio-open.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.dio-open" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">dio_open</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5 &lt; 5.1.0)</p><p class="refpurpose"><span class="refname">dio_open</span> &mdash; <span class="dc-title">
   Öffnet eine Datei (falls nötig, wird diese erzeugt) auf einem niedrigeren
   Level als es die C-Bibliotheks Ein-/Ausgabe-Stream-Funktionen erlauben
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.dio-open-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>dio_open</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$flags</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$mode</code><span class="initializer"> = 0</span></span>): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>dio_open()</strong></span> öffnet eine Datei und liefert einen
   Dateideskriptor zurück.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.dio-open-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Der Pfadname der zu öffnenden Datei.
      </p>
     </dd>
    
    
     <dt><code class="parameter">flags</code></dt>
     <dd>
      <p class="para">
       Der Parameter <code class="parameter">flags</code> ist ein bitweise ODER
       verknüpfter Wert bestehend aus Flags der folgende Liste. Dieser Wert
       <em>muss</em> entweder <strong><code><a href="dio.constants.php#constant.o-rdonly">O_RDONLY</a></code></strong>,
       <strong><code><a href="dio.constants.php#constant.o-wronly">O_WRONLY</a></code></strong>, oder <strong><code><a href="dio.constants.php#constant.o-rdwr">O_RDWR</a></code></strong>
       enthalten. Zusätzlich kann er eine beliebige Kombination der anderen
       Flags dieser Liste enthalten.
       <ul class="itemizedlist">
        <li class="listitem">
         <p class="para">
          <strong><code><a href="dio.constants.php#constant.o-rdonly">O_RDONLY</a></code></strong> - öffnet die Datei zum Lesezugriff.
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          <strong><code><a href="dio.constants.php#constant.o-wronly">O_WRONLY</a></code></strong> - öffnet die Datei zum Schreibzugriff.
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          <strong><code><a href="dio.constants.php#constant.o-rdwr">O_RDWR</a></code></strong> - öffnet die Datei zum Lesen und Schreiben.
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          <strong><code><a href="dio.constants.php#constant.o-creat">O_CREAT</a></code></strong> - erzeugt die Datei, falls diese nicht existiert
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          <strong><code><a href="dio.constants.php#constant.o-excl">O_EXCL</a></code></strong> - wird sowohl <strong><code><a href="dio.constants.php#constant.o-creat">O_CREAT</a></code></strong>
          als auch <strong><code><a href="dio.constants.php#constant.o-excl">O_EXCL</a></code></strong> angegeben und die Datei existiert
          bereits, schlägt <span class="function"><strong>dio_open()</strong></span> fehl.
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          <strong><code><a href="dio.constants.php#constant.o-trunc">O_TRUNC</a></code></strong> - falls die Datei bereits existiert, und sie für
          Schreibzugriff geöffnet wird, wird diese auf die Grösse 0
          zurückgesetzt
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          <strong><code><a href="dio.constants.php#constant.o-append">O_APPEND</a></code></strong> - setzt den Zeiger für Schreiboperationen an das Ende
          der Datei
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          <strong><code><a href="dio.constants.php#constant.o-nonblock">O_NONBLOCK</a></code></strong> - Setzt den Modus auf &quot;nonblocking&quot;
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          <strong><code><a href="dio.constants.php#constant.o-noctty">O_NOCTTY</a></code></strong> - hält das Betriebssystem davon ab,
          die geöffnete Datei als Prozess steuerndes Terminal zuzuweisen,
          wenn eine TTY Gerätedatei geöffnet wird.
         </p>
        </li>
       </ul>
      </p>
     </dd>
    
    
     <dt><code class="parameter">mode</code></dt>
     <dd>
      <p class="para">
       Wenn <code class="parameter">flags</code> das Flag <strong><code><a href="dio.constants.php#constant.o-creat">O_CREAT</a></code></strong>
       enthält, setzt <code class="parameter">mode</code> die Dateizugriffsrechte.
       <code class="parameter">mode</code> wird für die korrekte Ausführung benötigt,
       wenn <strong><code><a href="dio.constants.php#constant.o-creat">O_CREAT</a></code></strong> in <code class="parameter">flags</code>
       angegeben wird, und wird ansonsten ignoriert.
      </p>
      <p class="para">
       Die tatsächlichen Dateizugriffsrechte, die der erzeugten Datei zugewiesen
       werden, werden von der <em>umask</em> Einstellung des
       Prozesses wie üblich beeinflusst.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.dio-open-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Ein Dateideskriptor oder <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> bei Fehlern.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.dio-open-examples">
  <h3 class="title">Beispiele</h3>
  <div class="example" id="example-1">
   <p><strong>Beispiel #1 Öffnen eines Dateideskriptors</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$fd </span><span style="color: #007700">= </span><span style="color: #0000BB">dio_open</span><span style="color: #007700">(</span><span style="color: #DD0000">'/dev/ttyS0'</span><span style="color: #007700">, </span><span style="color: #0000BB">O_RDWR </span><span style="color: #007700">| </span><span style="color: #0000BB">O_NOCTTY </span><span style="color: #007700">| </span><span style="color: #0000BB">O_NONBLOCK</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">dio_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$fd</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.dio-open-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.dio-close.php" class="function" rel="rdfs-seeAlso">dio_close()</a> - Schlie&szlig;t eine Datei</span></li>
   </ul>
  </p>
 </div>

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