【发布时间】:2013-05-22 15:13:12
【问题描述】:
我想检查存储上的可用空间,我正在存储用户的附件。我选择了disk_free_space() 和disk_total_space()。结果是:
可用空间:5.47 GB
总空间:5.86 GB
所以占用的空间 = 0.39 GB。
我还使用filesize() 遍历文件以捕捉它们的大小。这些文件总共占用 18.34 GB。 (最大文件大小为 4 MB,因此 PHP 手册中关于 2GB 的注释适用)
所以:
总空间 - 可用空间 != 占用空间
为什么?
文件系统在 HP-UX 上。我使用同一个帐户测量了所有值 - 我从 php 脚本运行所有命令,通过 Internet 浏览器执行脚本。
我还检查了 Windows 中的功能。结果还可以。
我遇到了一些与函数相关的其他问题(How to get the disk space on a server?、How to determin how much space is freeon your server? (php)、How to detect the server space enough for the uploaded file or no?、How to get the disk space on a server?、Is it possible to get special Local Disk information from PHP?、php disk_total_space),但没有找到答案。
【问题讨论】:
-
我觉得Ur系统有一些分区,试试disk_free_space('/home/')和disk_total_space('/home/')
-
@Sergey 谢谢。他们都返回了
0。
标签: php filesystems size hp-ux