<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.filesystem.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.fdatasync.php',
    1 => 'fdatasync',
    2 => 'Synchronise les donn&eacute;es (mais pas les m&eacute;tadonn&eacute;es) avec le fichier',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Fonctions sur les syst&egrave;mes de fichiers',
  ),
  'prev' => 
  array (
    0 => 'function.fclose.php',
    1 => 'fclose',
  ),
  'next' => 
  array (
    0 => 'function.feof.php',
    1 => 'feof',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/filesystem/functions/fdatasync.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.fdatasync" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">fdatasync</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.1.0)</p><p class="refpurpose"><span class="refname">fdatasync</span> &mdash; <span class="dc-title">Synchronise les données (mais pas les métadonnées) avec le fichier</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.fdatasync-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>fdatasync</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="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Cette fonction synchronise le contenu du <code class="parameter">stream</code> sur le support de stockage, tout comme <span class="function"><a href="function.fsync.php" class="function">fsync()</a></span> le fait,
   mais elle ne synchronise pas les métadonnées des fichiers.
   Il est à noter que cette fonction est différente seulement dans les systèmes POSIX.
   Sous Windows, cette fonction est un alias de <span class="function"><a href="function.fsync.php" class="function">fsync()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.fdatasync-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">stream</code></dt>
     <dd>
      <p class="para">Le pointeur de fichier doit être valide et pointer
sur un fichier ouvert avec succès par <span class="function"><a href="function.fopen.php" class="function">fopen()</a></span> ou
<span class="function"><a href="function.fsockopen.php" class="function">fsockopen()</a></span> (et pas encore fermé par <span class="function"><a href="function.fclose.php" class="function">fclose()</a></span>).</p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.fdatasync-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Cette fonction retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en cas de succès ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.fdatasync-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>fdatasync()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$file </span><span style="color: #007700">= </span><span style="color: #DD0000">'test.txt'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$stream </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">, </span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$stream</span><span style="color: #007700">, </span><span style="color: #DD0000">'test data'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$stream</span><span style="color: #007700">, </span><span style="color: #DD0000">"\r\n"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$stream</span><span style="color: #007700">, </span><span style="color: #DD0000">'additional data'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fdatasync</span><span style="color: #007700">(</span><span style="color: #0000BB">$stream</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$stream</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.fdatasync-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.fflush.php" class="function" rel="rdfs-seeAlso">fflush()</a> - Envoie tout le contenu g&eacute;n&eacute;r&eacute; dans un fichier</span></li>
    <li><span class="function"><a href="function.fsync.php" class="function" rel="rdfs-seeAlso">fsync()</a> - Synchronise les modifications apport&eacute;es au fichier (y compris les m&eacute;tadonn&eacute;es)</span></li>
   </ul>
  </p>
 </div>


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