位置: 编程技术 - 正文

PHP:fileperms()的用法_Filesystem函数(php_fileinfo作用)

编辑:rootadmin
fileperms

推荐整理分享PHP:fileperms()的用法_Filesystem函数(php_fileinfo作用),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:php file_append,php_fileinfo作用,php_fileinfo,php的file_get_contents,php_fileinfo作用,php_fileinfo作用,php中file,php中file,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 4, PHP 5)

fileperms — 取得文件的权限

说明 int fileperms ( string $filename )

取得文件的权限。

参数

filename

文件的路径。

返回值

以数字模式返回文件的访问权限。 Returns the file&#;s permissions as a numeric mode. Lower bits of this mode are the same as the permissions expected by chmod(), however on most platforms the return value will also include information on the type of file given as filename. The examples below demonstrate how to test the return value for specific permissions and file types on POSIX systems, including Linux and Mac OS X.

For local files, the specific return value is that of the st_mode member of the structure returned by the C library&#;s stat() function. Exactly which bits are set can vary from platform to platform, and looking up your specific platform&#;s documentation is recommended if parsing the non-permission bits of the return value is required.

范例 PHP:fileperms()的用法_Filesystem函数(php_fileinfo作用)

Example #1 以八进制的形式显示文件的权限

<?phpechosubstr(sprintf('%o',fileperms('/tmp')),-4);echosubstr(sprintf('%o',fileperms('/etc/passwd')),-4);?>

以上例程会输出:

Example #2 输出全部权限

<?php$perms=fileperms('/etc/passwd');if(($perms&0xC)==0xC){//Socket$info='s';}elseif(($perms&0xA)==0xA){//SymbolicLink$info='l';}elseif(($perms&0x)==0x){//Regular$info='-';}elseif(($perms&0x)==0x){//Blockspecial$info='b';}elseif(($perms&0x)==0x){//Directory$info='d';}elseif(($perms&0x)==0x){//Characterspecial$info='c';}elseif(($perms&0x)==0x){//FIFOpipe$info='p';}else{//Unknown$info='u';}//Owner$info.=(($perms&0x)?'r':'-');$info.=(($perms&0x)?'w':'-');$info.=(($perms&0x)?(($perms&0x)?'s':'x'):(($perms&0x)?'S':'-'));//Group$info.=(($perms&0x)?'r':'-');$info.=(($perms&0x)?'w':'-');$info.=(($perms&0x)?(($perms&0x)?'s':'x'):(($perms&0x)?'S':'-'));//World$info.=(($perms&0x)?'r':'-');$info.=(($perms&0x)?'w':'-');$info.=(($perms&0x)?(($perms&0x)?'t':'x'):(($perms&0x)?'T':'-'));echo$info;?>

以上例程会输出:

错误/异常

失败时抛出E_WARNING警告。

注释

Note: 此函数的结果会被缓存。参见clearstatcache() 以获得更多细节。

Tip

自 PHP 5.0.0 起, 此函数也用于某些URL 包装器。请参见 支持的协议和封装协议以获得支持 stat() 系列函数功能的包装器列表。

参见

chmod() - 改变文件模式 is_readable() - 判断给定文件名是否可读 stat() - 给出文件的信息

PHP:filemtime()的用法_Filesystem函数 filemtime(PHP4,PHP5)filemtime取得文件修改时间说明intfilemtime(string$filename)本函数返回文件中的数据块上次被写入的时间,也就是说,文件的内容上次被修改的

PHP:fileowner()的用法_Filesystem函数 fileowner(PHP4,PHP5)fileowner取得文件的所有者说明intfileowner(string$filename)取得文件的所有者。参数filename文件的路径。返回值返回文件所有的用户ID,如果出错

PHP:filegroup()的用法_Filesystem函数 filegroup(PHP4,PHP5)filegroup取得文件的组说明intfilegroup(string$filename)取得该文件所属组的ID。组ID以数字格式返回,用posix_getgrgid()来将其解析为组名。参数filen

标签: php_fileinfo作用

本文链接地址:https://www.jiuchutong.com/biancheng/285220.html 转载请保留说明!

上一篇:PHP:diskfreespace()的用法_Filesystem函数

下一篇:PHP:filemtime()的用法_Filesystem函数(php的file函数)

  • 汇算清缴涉及哪些调整
  • 小规模纳税人如何做账
  • 运动手环的税收分类编码是
  • 土地增值税纳税义务人
  • 调减加计抵减额会计分录
  • 电子承兑对方拒绝签收
  • 公司账户进账必须交税吗
  • 电子承兑逾期提示付款说明怎么写
  • 开发成本公式
  • 用于职工住宿的会计科目
  • 销售产品产生的运杂费分录
  • 企业所得税工资薪金支出怎么填
  • 已抵扣专用发票冲红怎么操作
  • 支付宝手续费由谁承担
  • 加速折旧做账
  • 供应商不给我们开发票,我怎么入账
  • 资质挂靠人员需要交个税吗?
  • 机票上exempt yqcny是什么意思?
  • 报关单毛重错了被海关查到
  • 年报弥补以前年度亏损了还需要填107040表吗
  • 建筑企业怎么缴纳社保
  • 本月的应收账款,实际到下个月了会怎么样
  • hbuilder打包apk
  • mac电脑新手使用
  • windows 10 21h1
  • 报销租房费用开发票
  • 货款形式返还
  • 重装win7系统鼠标键盘没反应
  • 关于增值税专用发票
  • vue3+ts+vite
  • php编程入门教程
  • thinkphp技巧
  • 会计记账凭证摘要如何编写
  • 如何办理出口退税备案
  • 职工福利费的范围有哪些
  • 报关单运费cny
  • 收到投资款怎么做账
  • 用友t3财务报表导出
  • 每个月计提折旧的分录
  • 公司向银行贷款利息是多少
  • python中类的属性
  • 贸易公司开发票进项跟销项不符合怎么办?
  • 金银首饰以旧换新增值税处理
  • 工程预收款税票
  • 预付账款是负数有什么税收风险
  • 哪些发票不能用
  • 合并企业如何缴纳印花税
  • 房屋租赁产生的税费叫什么
  • 研发收入超过研发成本
  • 就业中心办理退工
  • sqlserver表排序
  • win10图片修改
  • windows server 2008.
  • 如何将苹果手机复制
  • linux自动清理内存软件
  • linux7修改ssh端口
  • 制作xp系统盘需要多大u盘
  • prevsrv.exe - prevsrv是什么进程 有什么用
  • windows8的word在哪里
  • windows7 运行
  • ie 无法打开
  • 五步轻松实现zTree的使用
  • 简单模拟电路图
  • python 执行命令
  • 查看进程pid的命令是
  • unity怎么用
  • js限制数组长度
  • python3 args
  • unity 替代
  • 增删改查的语句
  • java sc is never closed
  • unity strangeioc
  • Android5.1 SystemUI 启动流程
  • Android OpenGL ES(九)----构建几何物体
  • node ffi
  • python中执行同一函数3次
  • 游戏客服怎么跟客户聊天
  • js实现复制文本
  • 增值税消费税申报比对不符怎么办
  • 财务年中工作总结简短
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设