src/Pure/ML-Systems/mosml.ML
changeset 26220 d34b68c21f9a
parent 26084 a7475459c740
child 26223 f4a1a96cc07c
--- a/src/Pure/ML-Systems/mosml.ML	Thu Mar 06 20:17:49 2008 +0100
+++ b/src/Pure/ML-Systems/mosml.ML	Thu Mar 06 20:17:50 2008 +0100
@@ -38,6 +38,7 @@
 use "ML-Systems/universal.ML";
 use "ML-Systems/multithreading.ML";
 use "ML-Systems/time_limit.ML";
+use "ML-Systems/system_shell.ML";
 
 
 (*low-level pointer equality*)
@@ -178,38 +179,11 @@
 
 (** OS related **)
 
-(* current directory *)
-
 val cd = OS.FileSys.chDir;
 val pwd = OS.FileSys.getDir;
 
-
-(* system command execution *)
-
-(*execute Unix command which doesn't take any input from stdin and
-  sends its output to stdout; could be done more easily by Unix.execute,
-  but that function doesn't use the PATH*)
-fun execute command =
-  let
-    val tmp_name = FileSys.tmpName ();
-    val is = (Process.system (command ^ " > " ^ tmp_name); TextIO.openIn tmp_name);
-    val result = TextIO.inputAll is;
-  in
-    TextIO.closeIn is;
-    FileSys.remove tmp_name;
-    result
-  end;
-
-(*plain version; with return code*)
-fun system cmd =
-  if Process.system cmd = Process.success then 0 else 1;
-
-
 val string_of_pid = Int.toString;
 
-
-(* getenv *)
-
 fun getenv var =
   (case Process.getEnv var of
     NONE => ""