folder (directory) operations

Source: Internet
Author: User

//Traverse directory//1. Returns all files in the directory * represents all the suffix files required to return *. suffix can be filtered by suffixGlob("Path/*"); //2. Pointer traversal//Open Directory Resource$ variable Name=Opendir("Path");//Read File while($v=Readdir($ variable Name)){    if($v=="." ||$v=="..")    {            }    Else    {    Echo $v." <br> ";//first time. Current directory The second time: represent the parent directory the third time is the real file.    }}//Close Directory ResourceClosedir("$ variable Name");//folder Operation//1. Creating a directorymkdir("Path/directory Name"); //2. Delete directory can only delete empty directoryrmdir("Path/directory Name");//3. Moving the directoryRename("Path to move", "Path after move/directory name after move");//Rename , move folder

folder (directory) operations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.