Be more cautious creating log directories
[hcoop/domtool2.git] / src / slave.sml
index b0148f1..719b417 100644 (file)
@@ -56,7 +56,12 @@ fun registerPostHandler handler =
     end
 
 fun handleChanges fs = (!preHandler ();
     end
 
 fun handleChanges fs = (!preHandler ();
-                       app (!fileHandler) fs;
+                       app (fn recd as {action, file, ...} =>
+                               (!fileHandler recd;
+                                if action = Delete andalso Posix.FileSys.access (file, []) then
+                                    OS.FileSys.remove file
+                                else
+                                    ())) fs;
                        !postHandler ())
 
 fun shell ss = OS.Process.isSuccess (OS.Process.system (String.concat ss))
                        !postHandler ())
 
 fun shell ss = OS.Process.isSuccess (OS.Process.system (String.concat ss))