[LON-CAPA-cvs] cvs: loncom /publisher loncfile.pm

raeburn raeburn at source.lon-capa.org
Mon Jun 4 15:23:41 EDT 2012


raeburn		Mon Jun  4 19:23:41 2012 EDT

  Modified files:              
    /loncom/publisher	loncfile.pm 
  Log:
  - Ignore .DS_Store file when determining if a directory in Authoring is
    empty and so can be deleted via web interface.
  
  
Index: loncom/publisher/loncfile.pm
diff -u loncom/publisher/loncfile.pm:1.114 loncom/publisher/loncfile.pm:1.115
--- loncom/publisher/loncfile.pm:1.114	Mon Nov 14 00:20:31 2011
+++ loncom/publisher/loncfile.pm	Mon Jun  4 19:23:41 2012
@@ -9,7 +9,7 @@
 #  and displays a page showing the results of the action.
 #
 #
-# $Id: loncfile.pm,v 1.114 2011/11/14 00:20:31 raeburn Exp $
+# $Id: loncfile.pm,v 1.115 2012/06/04 19:23:41 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -206,12 +206,13 @@
 # see if directory is empty
 # ignores any .meta, .save, .bak, and .log files created for a previously
 # published file, which has since been marked obsolete and deleted.
+# ignores a .DS_Store file put there when viewing directory via webDAV on MacOS. 
 sub empty_directory {
     my ($dirname,$phase) = @_;
     if (opendir DIR, $dirname) {
         my @files = grep(!/^\.\.?$/, readdir(DIR)); # ignore . and ..
         if (@files) { 
-            my @orphans = grep(/\.(meta|save|log|bak)$/, at files);
+            my @orphans = grep(/\.(meta|save|log|bak|DS_Store)$/, at files);
             if (scalar(@files) - scalar(@orphans) > 0) { 
                 return 0;
             } else {




More information about the LON-CAPA-cvs mailing list