Diff for /loncom/lond between versions 1.519 and 1.520

version 1.519, 2016/04/02 04:30:29 version 1.520, 2016/05/08 19:05:10
Line 2496  sub remove_user_file_handler { Line 2496  sub remove_user_file_handler {
     if (-e $file) {      if (-e $file) {
  #   #
  #   If the file is a regular file unlink is fine...   #   If the file is a regular file unlink is fine...
  #   However it's possible the client wants a dir.   #   However it's possible the client wants a dir 
  #   removed, in which case rmdir is more approprate:   #   removed, in which case rmdir is more appropriate.
    #   Note: rmdir will only remove an empty directory.
  #   #
         if (-f $file){          if (-f $file){
     unlink($file);      unlink($file);
                       # for html files remove the associated .bak file 
                       # which may have been created by the editor.
                       if ($ufile =~ m{^((docs|supplemental)/(?:\d+|default)/\d+(?:|/.+)/)[^/]+\.x?html?$}i) {
                           my $path = $1;
                           if (-e $file.'.bak') {
                               unlink($file.'.bak');
                           }
                       }
  } elsif(-d $file) {   } elsif(-d $file) {
     rmdir($file);      rmdir($file);
  }   }

Removed from v.1.519  
changed lines
  Added in v.1.520


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