位置: 编程技术 - 正文

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

  • 合伙企业主要缴纳的税种?
  • 销售货物提供运输是否分别核酸的例题
  • 税控盘如何看是否反写成功
  • 小规模纳税人可以开13%的发票吗
  • 企业内部转账应注意什么
  • 利润表里的所得税怎么算
  • 窗帘属于固定资产
  • 分公司企业所得税怎么缴纳
  • 申请发票增额有没有什么条件
  • 固定资产造成的损失可以税前扣除吗
  • 持有待售固定资产按照账面价值与可收回金额
  • 建账录入期初数据需要看哪个表
  • 金税三期社保费管理客户端v1.0.088(生产环境)
  • 公司实行注册资本认缴制
  • 开发成本存货减少
  • 2018年城镇医保
  • 供电局预收电费
  • 企业的其他账簿怎么做
  • 工资分两次发的风险是什么?
  • 单位给员工发工资要交税吗
  • 电子发票收款人和复核人可以是一个人吗
  • 企业所得税弥补
  • 业务招待费不超过销售收入的5‰
  • spf13-vim – Vim编辑器终极发布
  • 建筑公司购买材料需要写备注
  • 关于获得政府补助的公告
  • 研发费用加计扣除
  • 为离职员工代缴社保 论
  • 定额发票可以抵进项税吗
  • navione.exe是什么意思
  • phpunicode
  • 贷款发生减值
  • 销售旧设备如何开票
  • 进口付汇业务流程
  • html页面间传数据
  • vue three.js
  • 米尔巴特之战
  • yolov5参数设置
  • php批量更新数据库
  • html5新增的标签元素有哪些
  • php 中奖概率算法
  • web前端基础是什么
  • 命令执行语句
  • 二手车交易发票怎么收费
  • 劳务费如何支付
  • pythonsorted函数的作用
  • ps灰色模式怎么换回来快捷键
  • 年收入1500万是富人吗
  • 个体户开电子发票怎么申请
  • 小企业在购买商品过程中发生的费用
  • win7怎么配置
  • 公账上的钱怎么提出来
  • 企业缴纳社保要下载什么软件
  • 收入与支出怎么说
  • 建账的过程包括哪些内容
  • sql2000 sql2008
  • win7操作系统中将打开窗口拖动到屏幕顶端
  • arp攻击的原理及防范
  • windows8禁用uac
  • linux/unix
  • 在windows xp
  • Linux进入图形界面卡顿
  • soundtrax.exe - soundtrax是什么进程
  • linux ls命令什么意思
  • win8鼠标速度怎么调
  • vue.js 2.x
  • 隐藏应用名字
  • jquery教程与例子
  • java script
  • javascript 对象
  • 无序列表html
  • 深圳12366怎么转人工
  • 网上怎么申报地税
  • 污水处理厂房产税优惠政策
  • 长春税务局电话举报
  • 江苏宿迁个体户那个园区好
  • 山东地税局网上办税平台
  • 陕西电子发票开票流程?
  • 增+6=多少
  • 怎么打印个人所得税扣缴申报表
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设