[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Tue May 12 21:58:16 EDT 2020


raeburn		Wed May 13 01:58:16 2020 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - In &remove_stale_resfile() 
    - check if unlink was successful, before sending unsub request.
    - also unlink the corresponding metadata file, if present. 
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1420 loncom/lonnet/perl/lonnet.pm:1.1421
--- loncom/lonnet/perl/lonnet.pm:1.1420	Mon Mar 30 11:04:08 2020
+++ loncom/lonnet/perl/lonnet.pm	Wed May 13 01:58:16 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1420 2020/03/30 11:04:08 raeburn Exp $
+# $Id: lonnet.pm,v 1.1421 2020/05/13 01:58:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3528,12 +3528,15 @@
                                     $stale = 1;
                                 }
                                 if ($stale) {
-                                    unlink($fname);
-                                    if ($uri!~/\.meta$/) {
-                                        unlink($fname.'.meta');
+                                    if (unlink($fname)) {
+                                        if ($uri!~/\.meta$/) {
+                                            if (-e $fname.'.meta') {
+                                                unlink($fname.'.meta');
+                                            }
+                                        }
+                                        &reply("unsub:$fname",$homeserver);
+                                        $removed = 1;
                                     }
-                                    &reply("unsub:$fname",$homeserver);
-                                    $removed = 1;
                                 }
                             }
                         }




More information about the LON-CAPA-cvs mailing list