Diff for /loncom/lond between versions 1.291 and 1.292

version 1.291, 2005/07/12 21:29:58 version 1.292, 2005/08/26 19:40:38
Line 48  use localauth; Line 48  use localauth;
 use localenroll;  use localenroll;
 use localstudentphoto;  use localstudentphoto;
 use File::Copy;  use File::Copy;
   use File::Find;
 use LONCAPA::ConfigFileEdit;  use LONCAPA::ConfigFileEdit;
 use LONCAPA::lonlocal;  use LONCAPA::lonlocal;
 use LONCAPA::lonssl;  use LONCAPA::lonssl;
Line 1363  sub du_handler { Line 1364  sub du_handler {
     #  etc.      #  etc.
     #      #
     if (-d $ududir) {      if (-d $ududir) {
  #  And as Shakespeare would say to make   my $total_size=0;
  #  assurance double sure,    my $code=sub { 
  # use execute_command to ensure that the command is not executed in      if ($_=~/\.\d+\./) { return;} 
  # a shell that can screw us up.      if ($_=~/\.meta$/) { return;}
         my $file_list =  execute_command("find $ududir -not -regex '.*\.[0-9]+\.[^\.]+' -not -name '*.meta' -print");      $total_size+=(stat($_))[7];
  my $duout = execute_command("du -ks $file_list");   };
  $duout=~s/[^\d]//g; #preserve only the numbers   find($code,$ududir);
  &Reply($client,"$duout\n","$cmd:$ududir");   $total_size=int($total_size/1024);
    &Reply($client,"$total_size\n","$cmd:$ududir");
     } else {      } else {
   
  &Failure($client, "bad_directory:$ududir\n","$cmd:$ududir");    &Failure($client, "bad_directory:$ududir\n","$cmd:$ududir"); 
   
     }      }
     return 1;      return 1;
 }  }

Removed from v.1.291  
changed lines
  Added in v.1.292


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>