位置: 编程技术 - 正文

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

  • 怎么结转未交增值税
  • 可供出售金融资产和交易性金融资产
  • 医疗垃圾处理费标准2020
  • 经营范围没有的可以开票吗
  • 关联交易金额是付款还是入账
  • 装修公司开劳务费发票可以有材料进项票吗
  • 注册资本5块钱
  • 信用减值损失在利润表怎么填列
  • 非正常损失进项税额转出会计分录
  • 环境评估费应计入什么科目
  • 费用类都有哪些账户
  • 餐饮无票收入怎么做账
  • 有限合伙企业jp
  • 一直不营业的企业叫什么
  • 支付职工补贴计入什么科目
  • 高新技术企业怎么申报企业所得税
  • 如何确定旧机器的折旧年限?
  • 季度申报表营业成本怎么填
  • 服务业成本怎么做账
  • 其他应付款调整到其他应收款
  • 持有至到期投资减值准备
  • 专用发票的设计流程
  • 如何养成良好的安全行为
  • phpemail正则
  • php写post接口
  • win10系统安装详细步骤
  • 石楠花 开花
  • 领用材料已抵扣进项税
  • 外籍人员工资薪金扣除
  • 以摊余成本计量且其变动计入当期损益
  • 应税货物及劳务无法录入
  • 论文implications
  • 关税计入纳税总额么
  • 装饰工程公司施工一般包括哪些内容?
  • 企业年度预算编制流程
  • 小规模纳税人开农产品免税发票
  • 专票当天可以领取吗
  • 民营医院发票样式
  • 个人终止投资经营的情形
  • 个人独资企业用企业资金进行个人消费
  • sqlserver还原数据库一直显示正在执行0%
  • 高速公路通行发票税率
  • 劳务费走应付职工薪酬
  • sql server single user
  • 工程施工的间接费用如何归集分配
  • 企业所得税征收方式有哪些?
  • 损益类账户怎么记入总账
  • 增值税专用发票有几联?
  • 在建工程里面的费用最后怎样结转
  • 电子银行承兑到期没有兑现怎么办
  • 模具维修费用清单表格
  • 盈利能力分析的理论意义和现实意义
  • 最新的会计规定出台时间
  • 收到承兑汇票如何写收据
  • 磅差怎么开票
  • 开发成本转到哪里
  • 开红字发票购买方和销货方有哪些操作不同?
  • mysql批量执行sql文件
  • MySQL数据迁移到oracle
  • 电脑显示配置windows
  • window10打开rar文件
  • debian更改用户名
  • 安装完win8后没有无线网络
  • mac入门视频教程
  • 如何解决windows副本不是正版
  • vs2012配置opencv4.8
  • shell随机
  • linux的shell脚本编程
  • ms-dos7.10如何安装
  • python numpy矩阵
  • jQuery中trigger()与bind()用法分析
  • unity3d怎么编程
  • Drag and drop in unity
  • jquery mobile开发环境
  • js运行效率
  • jQuery ajax方法传递中文时出现中文乱码的解决方法
  • 延时加载js文件
  • 告诉你什么是无限的恐怖日语
  • 大排量车船税怎么减免
  • 开电影院有哪些要求
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设