jeudi 2 avril 2015

How to list all files in the directories



  1. how to list all files in parent and sub directory for multilpe dir


    $dir="/home/httpd/cgi-bin/r/met";



    opendir(DIR,"/home/httpd/cgi-bin/r/met")||die"error";

    while($line=readdir DIR)
    {

    print"$line\n";

    opendir DIR1,"$dir/$line"||die"error";

    while($line1=readdir DIR1)
    {
    print"$line1\n";
    }
    }
    closedir DIR;
    closedir DIR1;



Aucun commentaire:

Enregistrer un commentaire