位置: 编程技术 - 正文

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

  • 个人所得缴税租房减免该怎么弄?
  • 收到的税费返还应在支付的税费项目中扣除判断题
  • 新个税计算公式怎么输入excel
  • 吊车租赁有限公司
  • 机械费可以计入劳务单价吗
  • 预收贷方余额表示什么意思
  • 地价计入房产原值公式
  • 普通发票不能抵扣进项税额怎么做账
  • 企业物流成本会计核算问题研究
  • 小企业外币交易
  • 应付职工薪酬如何具体到个人
  • 营改增抵减的销项税额是什么意思
  • 注册资本低于实际投资
  • 计入无形资产
  • 公司开展文体活动总结
  • 甲供材的范围
  • 土地租赁合同交不交印花税
  • 暂估入库的材料需要做T型账户嘛?
  • 服装批发零售交什么税
  • 机票报销发票抬头要开公司的吗
  • 技术转让所得减去成本吗
  • 股东投资款印花税多少
  • 关于个人所得税纳税人的说法正确的有
  • 先抵押 后租赁
  • 办理对公账户手续流程
  • 附加税申报表
  • 支付短期借款利息
  • 加计扣除税怎么出分录
  • 应收票据质押怎么看
  • 诈骗犯查询
  • macos使用技巧
  • 股东分担债务
  • 补缴增值税和滞纳税区别
  • 财务变更是什么意思
  • html页面中利用______标签可引入jquery库
  • 排污费应计入什么会计科
  • 常见的财务报表分析方法有多选题
  • csinsm32.exe是安全的进程吗 csinsm32进程有哪些用处
  • vue3自定义指令
  • 开发支出应属于什么科目
  • 从事广告代理业工作
  • 印花税怎么核算的
  • 企业类型变更是什么意思
  • joomla安装教程
  • java单点登录token
  • vue路由的理解
  • nmblookup安装
  • 应收账款和应付账款都是负数
  • 应收账款坏账准备计提方法
  • 卖家运费险是不是退货免费
  • 计提怎么理解
  • 民营医疗机构是指哪些
  • vuex 3
  • 织梦怎么建站
  • 织梦发布文章栏目怎么不显示
  • 长期资产包含哪些
  • 小微企业0税务报税流程
  • 发票上的金额是含税还是不含税
  • sql server sql文件
  • 实收资本冲减了工商年检怎么办呢
  • 税控盘和维护费440元抵减增值税吗
  • 劳务公司可以用工资表做成本
  • 加工费怎么做账
  • 固定资产置换存货
  • 商贸企业涉税问题
  • 本月无收入还用结转吗
  • 固定资产的入账时间应该是什么时间
  • csv数据量太大怎么拆分
  • sql的数据操作
  • 在Linux环境下mysql的root密码忘记解决方法(三种)
  • 繁体软件在简体运行
  • wlms.exe是什么
  • win8系统怎么远程电脑
  • ubuntu netbook
  • win7系统咋样
  • 脸部两旁的骨头
  • android在手机上运行
  • 怎么用js实现滑动效果
  • android学什么
  • 地税局纪检组长黄斌简历
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设