changeset 1700:2b04104896a8

Delete C temporary directories, even if other files wind up there
author Adam Chlipala <adam@chlipala.net>
date Tue, 13 Mar 2012 20:17:23 -0400
parents 3320eba6bad5
children 6a4461757829
files src/compiler.sml
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/compiler.sml	Tue Mar 13 13:36:26 2012 -0400
+++ b/src/compiler.sml	Tue Mar 13 20:17:23 2012 -0400
@@ -1425,10 +1425,10 @@
                     in
                         OS.FileSys.mkDir dir;
                         (cname, oname,
-                      fn () => (OS.FileSys.remove cname;
-                                OS.FileSys.remove oname;
-                                OS.FileSys.rmDir dir)
-                         handle OS.SysErr _ => OS.FileSys.rmDir dir)
+                      fn () => (if OS.Process.isSuccess (OS.Process.system ("rm -rf " ^ dir)) then
+                                    ()
+                                else
+                                    raise Fail ("Unable to delete temporary directory " ^ dir)))
                     end
             val ename = #exe job
         in