<?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 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.disk-total-space.php',
    1 => 'disk_total_space',
    2 => '返回一个目录的磁盘总大小',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => '文件系统函数',
  ),
  'prev' => 
  array (
    0 => 'function.disk-free-space.php',
    1 => 'disk_free_space',
  ),
  'next' => 
  array (
    0 => 'function.diskfreespace.php',
    1 => 'diskfreespace',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/filesystem/functions/disk-total-space.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.disk-total-space" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">disk_total_space</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.1.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">disk_total_space</span> &mdash; <span class="dc-title">返回一个目录的磁盘总大小</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.disk-total-space-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>disk_total_space</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$directory</code></span>): <span class="type"><span class="type"><a href="language.types.float.php" class="type float">float</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   给出一个包含有一个目录的字符串，本函数将根据相应的文件系统或磁盘分区返回所有的字节数。
   【译者注】本函数返回的是该目录所在的磁盘分区的总大小，因此在给出同一个磁盘分区的不同目录作为参数所得到的结果完全相同。
   在 Unix 和 Windows 200x/XP 中都支持将一个磁盘分区加载为一个子目录，这时正确使用本函数就很有意义。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.disk-total-space-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">directory</code></dt>
     <dd>
      <p class="para">
       文件系统的目录或者磁盘分区。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.disk-total-space-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   以浮点返回一个目录的磁盘总大小字节数， 或者在失败时返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.disk-total-space-examples">
  <h3 class="title">示例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>示例 #1 <span class="function"><strong>disk_total_space()</strong></span> 例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// $df 包含 "/" 目录的磁盘大小<br /></span><span style="color: #0000BB">$ds </span><span style="color: #007700">= </span><span style="color: #0000BB">disk_total_space</span><span style="color: #007700">(</span><span style="color: #DD0000">"/"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//在 Windows 下:<br /></span><span style="color: #0000BB">$ds </span><span style="color: #007700">= </span><span style="color: #0000BB">disk_total_space</span><span style="color: #007700">(</span><span style="color: #DD0000">"C:"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$ds </span><span style="color: #007700">= </span><span style="color: #0000BB">disk_total_space</span><span style="color: #007700">(</span><span style="color: #DD0000">"D:"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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


 <div class="refsect1 notes" id="refsect1-function.disk-total-space-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: <span class="simpara">此函数不能作用于<a href="features.remote-files.php" class="link">远程文件</a>，被检查的文件必须是可通过服务器的文件系统访问的。</span></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.disk-total-space-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.disk-free-space.php" class="function" rel="rdfs-seeAlso">disk_free_space()</a> - 返回目录中的可用空间</span></li>
   </ul>
  </p>
 </div>

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