最好的方法来获取大于2GB在php中的文件大小? [英] The best way to get the file size which greater than 2GB in php?

查看:129
本文介绍了最好的方法来获取大于2GB在php中的文件大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查windows OS上本地驱动器的文件大小.但是本机PHP函数filesize()仅在文件大小小于2GB时起作用.大于2GB的文件将返回错误的编号.因此,还有其他方法来获取大于2GB?

I want to check the file's size of local drives on windows OS.But the native PHP function filesize() only work when the file size less than 2GB. The file which greater than 2GB will return the wrong number.So,is there other way to get the file size which greater than 2GB?

非常感谢您!

推荐答案

您始终可以使用系统的文件大小方法.

You can always use the system's file size method.

对于Windows: 仅用于文件大小的Windows命令?

For Windows: Windows command for file size only?

@回声关闭

@echo off

回声%〜z1

对于Linux

stat -c %s filenam

您将通过exec php命令运行它们.

You would run these through the exec php command.

这篇关于最好的方法来获取大于2GB在php中的文件大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆