diff options
author | Adam Chlipala <adam@chlipala.net> | 2012-03-13 20:17:23 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2012-03-13 20:17:23 -0400 |
commit | d069e06ce669999393e5db361ac378804adbe3ba (patch) | |
tree | e19e1a4ed8b0b56b769385d073519878c63aefc7 | |
parent | 483df3cb6dbb33bb919fc7944527b339c6f70abc (diff) |
Delete C temporary directories, even if other files wind up there
-rw-r--r-- | src/compiler.sml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler.sml b/src/compiler.sml index 8ee86947..2ebf0d28 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -1425,10 +1425,10 @@ fun compile job = 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 |