<?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 => 'es',
  ),
  'this' => 
  array (
    0 => 'function.fstat.php',
    1 => 'fstat',
    2 => 'Lee las informaciones sobre un fichero a partir de un puntero de fichero',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Funciones del Sistema de Archivos',
  ),
  'prev' => 
  array (
    0 => 'function.fseek.php',
    1 => 'fseek',
  ),
  'next' => 
  array (
    0 => 'function.fsync.php',
    1 => 'fsync',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'es',
    'path' => 'reference/filesystem/functions/fstat.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.fstat" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">fstat</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">fstat</span> &mdash; <span class="dc-title">Lee las informaciones sobre un fichero a partir de un puntero de fichero</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.fstat-description">
  <h3 class="title">Descripción</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>fstat</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"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Recopila las informaciones sobre el fichero del cual
   se conoce el puntero <code class="parameter">stream</code>. <span class="function"><strong>fstat()</strong></span>
   es similar a la función <span class="function"><a href="function.stat.php" class="function">stat()</a></span>, excepto
   que utiliza un puntero de fichero, en lugar de un nombre de fichero.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.fstat-parameters">
  <h3 class="title">Parámetros</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">stream</code></dt>
     <dd>
      <p class="para">Un puntero del sistema de archivos de tipo <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>
que es habitualmente creado utilizando la función <span class="function"><a href="function.fopen.php" class="function">fopen()</a></span>.</p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.fstat-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="para">
   Devuelve un array que contiene las estadísticas para el fichero;
   el formato de este array se describe en detalle en la página de
   documentación de la función <span class="function"><a href="function.stat.php" class="function">stat()</a></span>.
   Devuelve <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> en caso de error.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.fstat-examples">
  <h3 class="title">Ejemplos</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Ejemplo #1 Ejemplo con <span class="function"><strong>fstat()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">// abre un fichero<br /></span><span style="color: #0000BB">$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">"/etc/passwd"</span><span style="color: #007700">, </span><span style="color: #DD0000">"r"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// lee las informaciones<br /></span><span style="color: #0000BB">$fstat </span><span style="color: #007700">= </span><span style="color: #0000BB">fstat</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// cierra el fichero<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// muestra el resultado<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">array_slice</span><span style="color: #007700">(</span><span style="color: #0000BB">$fstat</span><span style="color: #007700">, </span><span style="color: #0000BB">13</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Resultado del ejemplo anterior es similar a:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Array
(
    [dev] =&gt; 771
    [ino] =&gt; 488704
    [mode] =&gt; 33188
    [nlink] =&gt; 1
    [uid] =&gt; 0
    [gid] =&gt; 0
    [rdev] =&gt; 0
    [size] =&gt; 1114
    [atime] =&gt; 1061067181
    [mtime] =&gt; 1056136526
    [ctime] =&gt; 1056136526
    [blksize] =&gt; 4096
    [blocks] =&gt; 8
)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.fstat-notes">
  <h3 class="title">Notas</h3>
  <blockquote class="note"><p><strong class="note">Nota</strong>: <span class="simpara">
 Esta función no funciona con los <a href="features.remote-files.php" class="link">archivos remotos</a>,
 ya que el archivo examinado debe ser accesible en el sistema de archivos del servidor.
</span></p></blockquote>
 </div>


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