zoukankan      html  css  js  c++  java
  • perl进行目录的查看

    可用如下的PERL程序进行目录的浏览

    执行如:

    perl getdir.py D:\\设计模式Delphi版

    #getdir.py

    sub listfile{
            my $dir = shift @_;
            opendir DH, $dir;
            foreach my $file (readdir DH){
                    next if $file eq "." or $file eq "..";

                    $file = "$dir/$file";

                    if(-d $file){

                            &listfile($file);

                    }

                    else{

                            print $file . "\n";

                    }

            }

            return 1;

    }

    if(@ARGV!=1){
        print STDERR " program information \n";
        print STDERR " program usage \n";
        exit;
    }

    while(@ARGV){
        $dir = shift;
        &listfile($dir);
    }

  • 相关阅读:
    求js数组中最小值
    分析apply,call方法
    前端模块化详解
    js中形参的小练习
    js中return返回值小练习
    mysql 视图
    mysql 数据库语句
    mysql 事务管理
    vue-前端工程化
    Vue-router
  • 原文地址:https://www.cnblogs.com/djcsch2001/p/2108357.html
Copyright © 2011-2022 走看看