位置: 编程技术 - 正文

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

  • 非增值税应税项目可以抵扣进项税吗
  • 财务软件增值税
  • 所得税申报是什么
  • 出差人员个人原因延迟返回
  • 建筑发票开具与土增税扣有什么关系?
  • 个人独资企业怎么取钱
  • 筹建期的开办费计入什么科目
  • 纳税申报的流程如何?面试怎么说
  • 缺少订单停工费用如何做账
  • 哪些行业增值税率1%
  • 一般纳税人月销售额多少免征增值税
  • 公司账外现金
  • 对外销售产品
  • 建筑工地不按月发工资怎么办
  • 银行收取代发工资合法吗
  • 新会计准则有预提费用吗
  • 预收账款开票可以抵扣吗
  • 季报进入国税官网后怎么操作?
  • 个税更正申报需要逐月更正吗
  • 纳税人证明是完税证明吗
  • 过路费企业所得税汇算清缴计入什么科目?
  • 增值税纳税申报表怎么填
  • 应付暂估应在何时申报
  • 二月份个税申报时间
  • 银行余额不平怎么快速找原因
  • 劳务收入不足800
  • 房地产企业卖出去的房子需要缴纳城镇土地使用税吗
  • 合伙企业个人所得税计算案例
  • 商业汇票收款到什么账户
  • 暂估冲回账务处理
  • 静态回收期怎么计算
  • 技术开发免征增值税怎么开票
  • 股东借钱给公司怎么写借条
  • windows11iso镜像多久更新一次
  • 企业所得税纳税调整事项有哪些
  • 企业常见的涉税风险
  • 企业重组并购条件
  • KbdTray.exe - KbdTray是什么进程 有什么作用
  • 前端数据统计图
  • 工程完工后有质量问题能解除合同吗
  • 企业之间拆借资金
  • 公司偷税漏税有哪些表现形式
  • 大雾山国家公园在哪里
  • vue聊天系统
  • 建筑会计和会计的区别
  • 路径规划原理
  • 查询命令的操作步骤
  • 公允价值变动损益
  • 体育用品账务处理
  • 工业企业辅助生产设备
  • 企业分红所得需要缴纳企业所得税吗
  • 福利用品可以抵增值税吗
  • 预计表示什么意思
  • 固定资产对外投资
  • 无形资产减值准备借贷方向增减
  • 小规模减免税收入
  • 律师事务所如何成立
  • 本期应征增值税销售额是什么意思
  • 长期待摊销费用属于流动资产吗
  • 收付转三种凭证怎么装订
  • 长期股权投资属于什么会计要素
  • mysql5.7.29安装
  • linux lv扩容
  • 在windows七中
  • win7更改win10系统要怎么更改
  • mac系统有txt吗
  • 使用linux的电脑
  • JavaScript的Ext JS框架中的GridPanel组件使用指南
  • javascript数组的方法
  • css渲染规则
  • python利用for循环求1到100的奇数之和
  • ubuntu20.04中文
  • jquery $each
  • bash脚本语法
  • 新疆12366网上办税
  • 彩票中500万自己能得多少
  • 金税三期怎么打完税凭证
  • 深圳市国家税务局赵雨婷
  • 属于资源税类的税种有哪些
  • 水库淹没区耕地补偿标准
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设