位置: 编程技术 - 正文

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

  • 税务局防范税收风险的措施
  • 金税三期的内容是什么
  • 股票初始计量后按新金融准则计入哪个科目
  • 记账凭证红字冲销
  • 发票开票地址是注册地址还是经营地址
  • 应付账款坏账了怎么处理
  • 一般纳税人销售自己使用过的汽车
  • 关联方交易影响因素
  • 外商投资企业是中国企业吗
  • 服务费和佣金的关系
  • 没有营业收入要报税吗
  • 租赁算投资吗
  • 多开进来的发票怎么结算税点呢?
  • 公司年会增值税专用发票可以抵扣吗?
  • 营改增对象
  • 工程的进项税怎么处理
  • 医院开发票需要税号吗
  • 三代手续费入账
  • 年终奖的税收筹措是什么
  • 损益表和利润表的关系
  • 工会经费的开支必须取得发票么
  • 什么叫二类费用
  • 待处理财产损益的二级科目
  • 事业单位财政拨款是什么意思
  • mac系统怎么更改输入法
  • 移动手机网速测试
  • 主板bios在线升级
  • 动态壁纸怎么设置锁屏
  • php+ mysql教程
  • php教程100
  • 电子钥匙续费应用在哪里
  • powerremind.exe
  • php零基础入门教程
  • PHP:imagecreatefromgd2part()的用法_GD库图像处理函数
  • 伦索伊斯马拉赫塞斯国家公园
  • 合理损耗企业所得税税率
  • uniapp传值
  • 可供出售交易资产
  • openai创始人阿尔特曼 取向
  • 预提的奖金能不能提前申报个税
  • 员工食堂买菜
  • ctrl ate del
  • 非事业单位企业退休年龄
  • 企业购房怎么贷款
  • 织梦如何使用
  • sql 行列转换
  • 织梦标签教程
  • 财务状况简单说明
  • 哪些进项税额不能抵扣
  • 小规模未开票收入填在哪里
  • sql数据对比语句
  • 扫码开票软件
  • 融资租赁手续费进项税能抵扣吗
  • 金税盘锁死341101
  • 免抵退 免退
  • 被收购企业账务怎么处理
  • 去银行更换帐户需要什么
  • 个人无偿赠与不动产税收管理
  • sql注入修补方法
  • mysql命令行配置
  • windows xp sp4 下载 windows xp sp4补丁包(非官方)
  • 笔记本带u
  • explorer.exe是啥意思
  • RHEL5 Apache+Tomcat整合,同时支持jsp与php
  • fpd文件是什么意思
  • centos如何操作
  • win7关闭右下角操作中心
  • win10关闭metro界面
  • 深度技术的系统好不好
  • react常用框架
  • 编程python怎么学
  • unity2.5d游戏地图处理
  • net命令大全
  • 安卓手机管家删除的照片怎么恢复
  • Javascript & DHTML 实例编程(教程)(三)初级实例篇1—上传文件控件实例
  • django框架详解
  • 购车发票购置税是否包含在内
  • pageoffice控件安装不上
  • 一般纳税人销售收入分录
  • 缴纳了车辆购置税能退吗
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设