我想检查存储空间,存储用户的附件。我和disk_free_space()和disk_total_space()一起去了。结果是:
免费空间:5.47GB 总空间:5.86GB
因此,占用的空间= 0.39 GB。
我还在文件中循环使用filesize()来捕获它们的大小。总共文件占用18.34GB。(最大文件大小为4MB,因此PHP手册中有关2GB的注释确实适用)
所以:
总空间-自由空间!=占用空间
为什么?
文件系统位于HP-UX上。我使用同一个帐户度量了所有的值--我使用internet浏览器执行脚本,从php脚本运行所有命令。
我还检查了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?、space),但没有找到答案。
发布于 2012-07-10 10:37:00
根据操作系统和所使用的文件系统,这在很大程度上取决于您调用函数的目录。原因是linux将多个驱动器装入一棵大树中。不能只调用disk_total_space('/'),因为这只会给出根分区的大小。试试disk_total_space($attachmentFolder);。
https://stackoverflow.com/questions/11411454
复制相似问题