svnno****@sourc*****
svnno****@sourc*****
2009年 5月 31日 (日) 22:59:54 JST
Revision: 3430 http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3430 Author: yutakapon Date: 2009-05-31 22:59:54 +0900 (Sun, 31 May 2009) Log Message: ----------- ActivePerl ã§åä½ããããã«æ¹ä¿®ããã Modified Paths: -------------- trunk/installer/check_sjis_code.pl -------------- next part -------------- Modified: trunk/installer/check_sjis_code.pl =================================================================== --- trunk/installer/check_sjis_code.pl 2009-05-30 15:33:27 UTC (rev 3429) +++ trunk/installer/check_sjis_code.pl 2009-05-31 13:59:54 UTC (rev 3430) @@ -3,17 +3,43 @@ # # pêÅhL gÉú{êªÜÜêĢȢ©ð²×éB # -# Usage(on Cygwin): -# perl ./check_sjis_code.pl ../doc/en/*/*/*.html > result.txt +# Usage(ActivePerl): +# perl check_sjis_code.pl > result.txt # -for ($i = 0 ; $i < @ARGV ; $i++) { -# print "$ARGV[$i]\n"; - check_sjis_code($ARGV[$i]); -} +get_file_paths('../doc/en/html'); exit(0); +sub get_file_paths { + my ($top_dir)= @_; + my @paths=(); + my @temp = (); + + #-- JgÌêðæ¾ --# + opendir(DIR, $top_dir); + @temp = readdir(DIR); + closedir(DIR); + foreach my $path (sort @temp) { + next if( $path =~ /^\.{1,2}$/ ); # '.' Æ '..' ÍXLbv + next if( $path =~ /^\.svn$/ ); # '.svn' ÍXLbv + + my $full_path = "$top_dir" . '/' . "$path"; + next if (-B $full_path); # oCit@CÍXLbv + +# print "$full_path\r\n"; # \¦¾¯ÈçSÄð\¦µÄêé------- + push(@paths, $full_path); # f[^ƵÄæèñÅàOÌæèݪú»³êé + if( -d "$top_dir/$path" ){ #-- fBNgÌêÍ©ª©gðÄÑo· + &get_file_paths("$full_path"); + + } else { + check_sjis_code($full_path); + + } + } + return \@paths; +} + # cf. http://charset.7jp.net/sjis.html # ShiftJIS ¶