#### FileHelper::createDirectory() 方法创建一个新目录.

~~~

/**

* @param string $path 要创建的目录的路径.

* @param int $mode 为新创建目录设置权限.

* @param bool $recursive 如果父目录不存在, 是否创建父目录.

* @return bool 是否成功创建目录.

*/

FileHelper::createDirectory($path, $mode = 0775, $recursive = true);

~~~

#### FileHelper::removeDirectory() 方法递归删除目录(及其所有内容).

~~~

/**

* @param string $dir 要递归删除的目录.

* @param array $options 删除目录的选项. 有效的选项有:

* - traverseSymlinks: boolean, 是否应该遍历目录的快捷方式.

* 默认为`false`, 意味着只会删除快捷方式, 而不删除快捷方式目录里的内容.

*/

FileHelper::removeDirectory($dir, $options = []);

~~~

#### FileHelper::copyDirectory() 方法将整个目录复制为另一个目录.

~~~

/**

* Copies a whole directory as another one.

* The files and sub-directories will also be copied over.

* @param string $src 源目录.

* @param string $dst 目的目录.

* @param array $options 复制目录的选项. 有效的选项有:

* - dirMode: integer, the permission to be set for newly copied directories. Defaults to 0775.

* - fileMode: integer, the permission to be set for newly copied files. Defaults to the current environment setting.

* - filter: callback, a PHP callback that is called for each directory or file.

* The signature of the callback should be: `function ($path)`, where `$path` refers the full path to be filtered.

* The callback can return one of the following values:

*

* * true: the directory or file will be copied (the "only" and "except" options will be ignored)

* * false: the directory or file will NOT be copied (the "only" and "except" options will be ignored)

* * null: the "only" and "except" options will determine whether the directory or file should be copied

*

* - only: array, list of patterns that the file paths should match if they want to be copied.

* A path matches a pattern if it contains the pattern string at its end.

* For example, '.php' matches all file paths ending with '.php'.

* Note, the '/' characters in a pattern matches both '/' and '\' in the paths.

* If a file path matches a pattern in both "only" and "except", it will NOT be copied.

* - except: array, list of patterns that the files or directories should match if they want to be excluded from being copied.

* A path matches a pattern if it contains the pattern string at its end.

* Patterns ending with '/' apply to directory paths only, and patterns not ending with '/'

* apply to file paths only. For example, '/a/b' matches all file paths ending with '/a/b';

* and '.svn/' matches directory paths ending with '.svn'. Note, the '/' characters in a pattern matches

* both '/' and '\' in the paths.

* - caseSensitive: boolean, whether patterns specified at "only" or "except" should be case sensitive. Defaults to true.

* - recursive: boolean, whether the files under the subdirectories should also be copied. Defaults to true.

* - beforeCopy: callback, a PHP callback that is called before copying each sub-directory or file.

* If the callback returns false, the copy operation for the sub-directory or file will be cancelled.

* The signature of the callback should be: `function ($from, $to)`, where `$from` is the sub-directory or

* file to be copied from, while `$to` is the copy target.

* - afterCopy: callback, a PHP callback that is called after each sub-directory or file is successfully copied.

* The signature of the callback should be: `function ($from, $to)`, where `$from` is the sub-directory or

* file copied from, while `$to` is the copy target.

* - copyEmptyDirectories: boolean, whether to copy empty directories. Set this to false to avoid creating directories

* that do not contain files. This affects directories that do not contain files initially as well as directories that

* do not contain files at the target destination because files have been filtered via `only` or `except`.

* Defaults to true. This option is available since version 2.0.12. Before 2.0.12 empty directories are always copied.

*/

FileHelper::copyDirectory($src, $dst, $options = []);

~~~

php yii2 finfo file,FileHelper:文件系统助手相关推荐

  1. yii2.0奥秘窥探:助手函数

    欢迎php技术加入laravel技术交流群 :784030154 在中文手册'助手函数'只提了三个函数,分别是url .html.array.具体查看https://www.yiichina.com/ ...

  2. Linux 2.6内核配置说明(File systems文件系统)

    转载博客博主的网址  https://blog.csdn.net/liu1164316159/article/category/1588671 Second extended fs support E ...

  3. AWS EFS(Elastic File System)文件系统

    AWS EFS文件系统实际上就是NFS文件系统,在使用时需要注意: - 创建完EFS,需要与一个Security group关联,决定哪些客户端主机可以访问 - 因为我们为每个instance 绑定一 ...

  4. linux文件系统基础--VFS中的file、dentry和inode--讲得非常透的一篇文章

    毕业以来,我花了很多时间阅读内核的代码,深入Linux内核架构,深入理解Linux内核,Robert Love的Linux内核设计与实现,Linux的虚拟文件系统对应章节,也读了很多遍,每一次读,都有 ...

  5. icc校色文件使用教程_Flink教程-flink 1.11使用sql将流式数据写入文件系统

    滚动策略 分区提交 分区提交触发器 分区时间的抽取 分区提交策略 完整示例 定义实体类 自定义source 写入file flink提供了一个file system connector,可以使用DDL ...

  6. Linux 中 7 个判断文件系统类型的方法

    文件通过文件系统在磁盘及分区上命名.存储.检索以及更新,文件系统是在磁盘上组织文件的方式. 文件系统分为两个部分:用户数据和元数据(文件名.创建时间.修改时间.大小以及目录层次结构中的位置等). 在本 ...

  7. 文件系统损坏导致虚拟机无法正常启动的问题及解决方法

    简介 计算机的文件系统是一种存储和组织计算机数据的方法,它使得对其访问和查找变得容易,文件系统使用文件和树形目录的抽象逻辑概念代替了硬盘和光盘等物理设备使用数据块的概念,用户使用文件系统来保存数据不必 ...

  8. linux 识别文件类型,技术|Linux 中 7 个判断文件系统类型的方法

    文件通过文件系统在磁盘及分区上命名.存储.检索以及更新,文件系统是在磁盘上组织文件的方式. 文件系统分为两个部分:用户数据和元数据(文件名.创建时间.修改时间.大小以及目录层次结构中的位置等). 在本 ...

  9. 利用stat命令获取Linux文件系统和文件的详细状态信息

    用途:stat命令用于显示文件或文件系统的状态信息,来自于coreutils软件包,一般系统自带此命令工具,它能获取与文件系统及文件相关的许多信息,具体用途见stat的功能选项.这些信息包括inode ...

最新文章

  1. c语言程序设教材计 乌云高娃,C语言程序设计教学课件作者第3版乌云高娃演示文稿C语言程序设计教学课件作者第3版乌云高娃演示文稿演示文稿第1章C语言程序设计基础课件.ppt...
  2. 学习之路-现代密码学基础-001
  3. 计算机书籍-Go语言并发之道
  4. 人工智能下一个前沿:可解释性
  5. linux+历史命令',Linux历史命令管理以及用法
  6. java怎么修改会员信息_JavaWeb用户信息管理系统-修改用户操作的实现
  7. Oracle入门(三A)之sqlplus
  8. scikit_learn 官方文档翻译(集成学习)
  9. 开发vue用什么ide_VUE项目开发前期需要准备和配置些什么环境?
  10. java学习之------位运算符实现两值交换
  11. Delphi调用C++写的dll示例
  12. 课程设计题目:电力系统运行方式分析和计算
  13. Kaggle泰坦尼克号提升准确率探索
  14. 计算机播放音乐没声音为什么,电脑没声音是怎么回事?教你怎么修复
  15. 文本自动生成研究进展与趋势之文本到文本的生成
  16. Charles修改ip
  17. vue 大量图片展示_Ant Design of Vue 展示多张图片
  18. linux命令字典式总结(按用途分类)
  19. 软件测试工程师笔试题
  20. 今日头条能干掉微信么?

热门文章

  1. leetcode 477. Total Hamming Distance | 477. 汉明距离总和
  2. 【MySQL】MySQL出现Waiting for table metadata lock的原因、解决方法
  3. 汇编语言 修改内存中的过时数据
  4. PAT1054 求平均值 (20 分)【从非法输入字符串中获取合法输入 cin.putback()】
  5. C语言 2048小游戏
  6. matlab pca求曲率和法向量_实践课堂 已给出实例的MATLAB求解大汇总(线性规划)...
  7. kafka消息反复从头开始消费问题排查
  8. pacificA架构介绍
  9. 【最简便解法】1069 微博转发抽奖 (20分)
  10. 绝对布局优势_街电福建全场景布局持续深化,构建全时续电服务强化行业领先优势...