位置: 编程技术 - 正文

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函数)

  • 煤炭企业生产能力
  • 税控盘维护费发票普通发票
  • 母子公司间借款利息交税吗
  • 个税三代手续费返还增值税报表怎么填
  • 定额中税金包含什么
  • 销售发票的会计处理
  • 企业有哪些行为
  • 汽车按揭费用收合法吗?
  • 增值税留抵的原因
  • 支付的票据承兑手续费计入财务费用
  • 外币账户的银行信息在哪查询
  • 制造费用的核算程序是什么
  • 外汇收支申报流程
  • 营改增后挂靠开票作收入吗?
  • 电子发票怎么缩小比例
  • 技术研发费加计扣除政策
  • 核定征收和定期定额的区别
  • 如何批量查询发票
  • 出口退税免退税
  • 亏损计提递延
  • 行纪合同的效力
  • php字符串变量
  • 建筑业预缴企业所得税表项目金额填合同金额吗
  • PHP:base64_decode()的用法_url函数
  • 识别税收风险点是什么
  • 出口货物如何开票入账
  • 在建工程完工后不转固定资产
  • 签了购房合同贷款办不下来怎么办
  • 前端加密后端解密代码
  • 有关五险一金的知识
  • 资产减值会计处理对利润的影响
  • php编程入门教程
  • 要点初见:Stable Diffusion NovelAI模型优质文字Tag汇总与实践【魔咒汇总】
  • vite 配置
  • 会计等式反映了六大会计要素的恒等关系
  • 微信小程序实训内容
  • 最新的目标检测算法2020
  • html游戏大全
  • 不得从销项税额中抵扣的是
  • 笨办法学python 3电子书下载
  • 收到商业承兑汇票怎么兑现
  • 亏损合同预计负债的会计分录
  • 跨境电商小规模怎么做账报税
  • mysql基本sql语句大全(基础用语篇)
  • 初学者应该看什么书
  • Dedecms评论同时发到QQ邮箱的实现方法
  • 电子承兑汇票贴现怎么操作
  • 餐饮服务需要卫生许可证吗
  • 计提缴纳企业所的会计分录怎么写
  • 个税汇算要清缴么
  • 金税四期对企业影响
  • 附加税减半征收政策是哪个文件
  • 厂房出租自用各种费用
  • 广告牌制作计入什么科目
  • 销售样品分录
  • 合同终止已开发怎么办
  • 赞助费入账需要多久
  • 社会医疗保险机构名词解释汇总
  • linux下安装mysql简单的方法
  • centos账号密码
  • mac 特殊符号
  • windows 8.1更新
  • 如何避免升级为查帐征收
  • 如何关闭win8快速启动
  • windows8怎么装windows10
  • win系统开发
  • 怎样关闭android系统的内存不足的系统通知
  • cocos开发游戏
  • python常见算法
  • js设置页面大小
  • javascript new fun的执行过程
  • Flow之一个新的Javascript静态类型检查器
  • pythonstl
  • 广东电子税务局app
  • 成品油消费税税率包括哪些
  • 企业年度总收入指的是什么意思
  • 住房公积金补扣
  • 法人注册怎么注册
  • 留抵税额怎么形成的
  • 房产税申报流程图
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设