Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/doc/htmlhelp_update_check.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4613 by maya, Sat Sep 3 05:22:04 2011 UTC revision 4731 by maya, Sat Nov 19 13:39:16 2011 UTC
# Line 7  Line 7 
7  #  perl htmlhelp_update_check.pl ja chm_file_name  #  perl htmlhelp_update_check.pl ja chm_file_name
8  #  #
9    
10  use Cwd;  use Cwd;
11  @dirstack = ();  @dirstack = ();
12    
13  $ret = do_main($ARGV[0], $ARGV[1]);  $ret = do_main($ARGV[0], $ARGV[1]);
14  if ($ret) {  if ($ret) {
# Line 25  sub do_main { Line 25  sub do_main {
25  }  }
26    
27    
28  sub get_file_paths {  sub get_file_paths {
29          my ($top_dir, $chmupdated)= @_;          my ($top_dir, $chmupdated)= @_;
30          my @paths=();          my @paths=();
31          my @temp = ();          my @temp = ();
32    
33          #-- カレントの一覧を取得 --#          #-- カレントの一覧を取得 --#
34          opendir(DIR, $top_dir);          opendir(DIR, $top_dir);
35          @temp = readdir(DIR);          @temp = readdir(DIR);
36          closedir(DIR);          closedir(DIR);
37          foreach my $path (sort @temp) {          foreach my $path (sort @temp) {
38                  next if( $path =~ /^\.{1,2}$/ );              # '.' と '..' はスキップ                  next if( $path =~ /^\.{1,2}$/ );              # '.' と '..' はスキップ
39                  next if( $path =~ /^\.svn$/ );                # '.svn' はスキップ                  next if( $path =~ /^\.svn$/ );                # '.svn' はスキップ
40                  next if( $path =~ /^.\.chm$/ );               # '*.chm' はスキップ                  next if( $path =~ /^.\.chm$/ );               # '*.chm' はスキップ
41    
42                  my $full_path = "$top_dir" . '/' . "$path";                  my $full_path = "$top_dir" . '/' . "$path";
43    
44                  if( -d "$top_dir/$path" ){                      #-- ディレクトリの場合は自分自身を呼び出す                  if( -d "$top_dir/$path" ){                      #-- ディレクトリの場合は自分自身を呼び出す
45                          if (&get_file_paths("$full_path", $chmupdated)) {                          if (&get_file_paths("$full_path", $chmupdated)) {
46                                  return 1;                                  return 1;
47                          }                          }
# Line 49  sub get_file_paths { Line 49  sub get_file_paths {
49                          if (&check_file($full_path, $chmupdated)) {                          if (&check_file($full_path, $chmupdated)) {
50                                  return 1;                                  return 1;
51                          }                          }
52                  }                  }
53          }          }
54          return 0;          return 0;
55  }  }
56    
57  sub check_file {  sub check_file {
58          my($filename, $chmupdated) = @_;          my($filename, $chmupdated) = @_;
59          my(@filestat) = stat $filename;          my(@filestat) = stat $filename;
60    
61          if ($filestat[8] > $chmupdated) {          if ($filestat[9] > $chmupdated) {
62                  return 1;                  return 1;
63          }          }
64          return 0;          return 0;

Legend:
Removed from v.4613  
changed lines
  Added in v.4731

SourceForge.JP is a Japanese version of SourceForge.net. For developments that are not related to Japan, we recommend you to use SourceForge.net.