#!c:/perl/bin
use strict;
use warnings;
our %params = ();
&getparams();
die "lack params error/n"
if(!exists($params) || !exists($params));
my $system;
my $separator;
my $file;
my $recursive;
my $dir;
my $filepattern;
my $strpattern;
my @dirs;
#get system type
if ( $^o =~ /mswin32/ )
else
$dir = $params;
$strpattern = $params;
$recursive = (exists($params)) ? $params : "false";
push(@dirs,$dir);
&searchstr_();
sub searchstr_()
else
) || ($file =~ /$params/))
close(filehandle);}}
}closedir(dirhandle);
&searchstr_() if(@dirs >0);
}sub getparams()
=$sparams[1];}}
使用遞迴遍歷資料夾
using system using system.data using system.configuration using system.collections using system.web using system.web.security using system.web.ui usin...
work Python 遞迴遍歷資料夾
import os def get log path dict log path home logs for root,dirs,files in os.walk log path log path dict dict for dir name in dirs dir path os.path.jo...
python 遞迴遍歷資料夾
usr bin python import os.path def readxmls folder 三個引數 分別返回1.父目錄 2.所有資料夾名字 不含路徑 3.所有檔案名字 for parent,dirnames,filenames in os.walk folder for dirname i...