位置: 编程技术 - 正文

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

  • 纳税信用等级是专管员评的吗
  • 发票在系统里作用大吗
  • 保理公司会计核算讲解
  • 出口退税账务处理
  • 红字发票开错了已上传如何作废
  • 低值易耗品如何报废
  • 结转已销售材料成本会计分录
  • 人民币结算意味着什么
  • 捐助建学校
  • 全年一次性奖金个税计算
  • 进项税额转出怎么申报
  • 单位参加城镇职工基本养老保险缴费基数怎么填写
  • 票据转让后本公司还有责任吗
  • 集体福利是否可以抵税
  • 英雄联盟怎么改左键移动
  • 应收账款贷方余额怎么在资产负债表中填列
  • 什么叫交付使用
  • 电脑怎么设置色盲模式
  • 会计中记账凭证的名词解释
  • 公司账户转账到出纳个人账户
  • php数组函数题目
  • replace.exe进程
  • ngwatch.exe
  • conda不是内部或外部命令
  • 员工的生活费会不会扣个税
  • 费用扣除制度
  • 缴纳租房押金会被骗吗
  • 篱笆的样子
  • CUDA(10.2)+PyTorch安装加配置 详细完整教程
  • 威斯康星州1976
  • 股权投资差额怎么算
  • ThinkPHP中Common/common.php文件常用函数功能分析
  • 销售产品是销项税额还是进项税额
  • vuex的五个属性及使用方法 简书
  • 富文本编辑器使用
  • python中拼接
  • 赠品视同销售会计分录要如何编制?
  • python关键字参数位置参数
  • phpmail
  • 收集整理数据
  • 印花税的计税依据为各种应税凭证上所记载的计税金额
  • mongotemplate 分页查询
  • 填写备案信息的目的
  • 转让无形资产使用权
  • 利润分配未分配利润期末有余额吗
  • 固定资产计提折旧凭证怎么做
  • 物流公司驾驶员安全教育培训
  • 工地上报销项目有哪些
  • 销售退回的账务处理会计分录图片
  • 其他应收款押金的现金流量
  • 工业企业会计与管理论文
  • 应收账款转让会计分录 未实际收到对价
  • 独立法人资格是独立核算
  • mysql中文乱码解决的命令
  • sql语句大全实例教程.pdf
  • 无法进入睡眠状态
  • tcpip. sys
  • win8无法完成更新正在撤销更改怎么办
  • win7系统出现蓝屏怎么进去桌面
  • win10新界面曝光
  • windows8怎么隐藏任务栏
  • win7窗口大小怎么设置
  • win7通过组策略阻止应用程序安装
  • linux中ctrl+c
  • win 10 build
  • cocos2dx android游戏防破解总结
  • perl-v
  • unity做3d游戏
  • unity3D游戏开发
  • docker save -o
  • 虚拟主机 推荐
  • iframe的替代方案
  • unity教程完整版
  • python中导入语句
  • python 上传文件到ftp
  • js闭包作用问题解决应用
  • jquery删除对象
  • 开票系统忘记密码怎么找回
  • 年终绩效奖金发放方案
  • 浙江省社保网报系统
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设