⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clean.pl

📁 S60 SDL is a Simple DirectMedia Layer adaptation for S60. SDL is a cross-platform multimedia library
💻 PL
字号:
#
# Copyright Markus Mertama 2008
# Cleanup folders from tree 
#

use  strict;
use File::Path qw(rmtree);

my $root = $ARGV[0];

my @dirs;

for(my $i = 1; $i <= $#ARGV; $i++)
	{
	push(@dirs, $ARGV[$i]);
	}


my @paths;	
find_paths($root, \@paths);	

foreach my $pathn (@paths)
	{	
	rmtree($pathn);
	}
	
my $count = @paths;
print "$count folders removed\n";	
	
sub find_paths
	{
	my ($dir, $paths) = @_;
	my $fullPath = "$dir";
	opendir(DIR, $fullPath) or die "Cannot open $fullPath: $!\n";
	my @items = readdir(DIR);
	closedir(DIR);
	foreach my $i (@items)
			{
			my $found = 0;
			foreach my $dir (@dirs)
				{
				if(lc($i) eq lc($dir))
					{
					push(@$paths, "$fullPath/$i");
					$found = 1;
					}
				}
			if(!$found && !($i =~ /^\.\.?$/))
				{
				my $subpath =	"$dir/$i";
				find_paths($subpath, $paths) if -d "$subpath";
				}
			}
	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -