Giter Site home page Giter Site logo

fileutil's Introduction

搬运整理,原作者不详

FileUtil PHP文件操作

PHP Library for simple to create/move/delete file/dir

Install

composer require jaeger/file-util

Examples

<?php
 use Jaeger\FileUtil;

 //测试建立文件夹,建一个a/1/2/3文件夹
 FileUtil::createDir('a/1/2/3');   

 //测试建立文件,在b/1/2/文件夹下面建一个3文件
 FileUtil::createFile('b/1/2/3'); 

 //测试建立文件,在b/1/2/文件夹下面建一个3.exe文件
 FileUtil::createFile('b/1/2/3.exe'); 

 //测试复制文件夹,建立一个d/e文件夹,把b文件夹下的内容复制进去
 FileUtil::copyDir('b','d/e');      

 //测试复制文件,建立一个b/b文件夹,并把b/1/2文件夹中的3.exe文件复制进去
 FileUtil::copyFile('b/1/2/3.exe','b/b/3.exe');

 //测试移动文件夹,建立一个b/c文件夹,并把a文件夹下的内容移动进去,并删除a文件夹
 FileUtil::moveDir('a/','b/c');   

 //测试移动文件,建立一个b/d文件夹,并把b/1/2中的3.exe移动进去
 FileUtil::moveFile('b/1/2/3.exe','b/d/3.exe'); 

 //测试删除文件,删除b/d/3.exe文件
 FileUtil::unlinkFile('b/d/3.exe');

 //测试删除文件夹,删除d文件夹
 FileUtil::unlinkDir('d');     
                  

fileutil's People

Contributors

jae-jae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ecshoper lyhiving

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.