src/Pure/System/standard_system.scala
changeset 50299 f70b3712040f
parent 50203 00d8ad713e32
child 50650 8922afc54b3d
equal deleted inserted replaced
50298:1426d478ccda 50299:f70b3712040f
     7 
     7 
     8 package isabelle
     8 package isabelle
     9 
     9 
    10 import java.lang.System
    10 import java.lang.System
    11 import java.util.regex.Pattern
    11 import java.util.regex.Pattern
    12 import java.util.Locale
       
    13 import java.net.URL
    12 import java.net.URL
    14 import java.io.{File => JFile}
    13 import java.io.{File => JFile}
    15 
    14 
    16 import scala.util.matching.Regex
    15 import scala.util.matching.Regex
    17 
    16 
    92     if (Platform.is_windows) {
    91     if (Platform.is_windows) {
    93       val result_path = new StringBuilder
    92       val result_path = new StringBuilder
    94       val rest =
    93       val rest =
    95         posix_path match {
    94         posix_path match {
    96           case Cygdrive(drive, rest) =>
    95           case Cygdrive(drive, rest) =>
    97             result_path ++= (drive.toUpperCase(Locale.ENGLISH) + ":" + JFile.separator)
    96             result_path ++= (Library.uppercase(drive) + ":" + JFile.separator)
    98             rest
    97             rest
    99           case Named_Root(root, rest) =>
    98           case Named_Root(root, rest) =>
   100             result_path ++= JFile.separator
    99             result_path ++= JFile.separator
   101             result_path ++= JFile.separator
   100             result_path ++= JFile.separator
   102             result_path ++= root
   101             result_path ++= root
   127   def posix_path(jvm_path: String): String =
   126   def posix_path(jvm_path: String): String =
   128     if (Platform.is_windows) {
   127     if (Platform.is_windows) {
   129       jvm_path.replace('/', '\\') match {
   128       jvm_path.replace('/', '\\') match {
   130         case Platform_Root(rest) => "/" + rest.replace('\\', '/')
   129         case Platform_Root(rest) => "/" + rest.replace('\\', '/')
   131         case Drive(letter, rest) =>
   130         case Drive(letter, rest) =>
   132           "/cygdrive/" + letter.toLowerCase(Locale.ENGLISH) +
   131           "/cygdrive/" + Library.lowercase(letter) +
   133             (if (rest == "") "" else "/" + rest.replace('\\', '/'))
   132             (if (rest == "") "" else "/" + rest.replace('\\', '/'))
   134         case path => path.replace('\\', '/')
   133         case path => path.replace('\\', '/')
   135       }
   134       }
   136     }
   135     }
   137     else jvm_path
   136     else jvm_path