blob: ce7c7cd26b157714e19e6bc85d18b7cf80c6014d [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001my $folder_path = $ARGV[0];
2my $file_postfix = $ARGV[1];
3
4my $strFileList;
5if(-d $folder_path)
6{
7 print "[BIN FOLDER]\n";
8 opendir (DIR, $folder_path) or die "Error: cannot open folder: $folder_path";
9 @files = grep {/.+_GFH/i} readdir DIR;
10 close DIR;
11
12 foreach (@files)
13 {
14 $ori_name = $_;
15 $_ =~ s/_GFH//i;
16 rename("$folder_path/$ori_name", "$folder_path/$_") or die "Error: fail to rename $ori_name to $_\n";
17 $strFileList .= "$folder_path/$_\n";
18 }
19
20}
21else
22{
23 print "[BIN FILE]\n";
24 $strFileList .= "$folder_path\n";
25}
26
27print $strFileList;
28exit 0;