src/Pure/Tools/isabelle_system.scala
changeset 27974 1dfb0e260e4c
parent 27962 28a306e675ba
child 27993 6dd90ef9f927
--- a/src/Pure/Tools/isabelle_system.scala	Sat Aug 23 23:07:44 2008 +0200
+++ b/src/Pure/Tools/isabelle_system.scala	Sat Aug 23 23:07:46 2008 +0200
@@ -2,7 +2,7 @@
     ID:         $Id$
     Author:     Makarius
 
-Isabelle system support: settings and path specifications.
+Isabelle system support -- basic Cygwin/Posix compatibility.
 */
 
 package isabelle
@@ -30,7 +30,7 @@
   }
 
 
-  /* File path specifications */
+  /* file path specifications */
 
   private val cygdrive_pattern = Pattern.compile("/cygdrive/([a-zA-Z])($|/.*)")
 
@@ -73,12 +73,14 @@
   }
 
 
-  /* Cygwin shell prefix */
+  /* processes */
 
-  def shell_prefix() = {
+  private def posix_prefix() = {
     if (Pattern.matches(".*-cygwin", getenv_strict("ML_PLATFORM")))
-      Some(platform_path("/bin/env"))
-    else None
+      List(platform_path("/bin/env"))
+    else Nil
   }
 
+  def exec(args: List[String]) = Runtime.getRuntime.exec((posix_prefix() ++ args).toArray)
+
 }