src/Pure/System/cygwin.scala
author wenzelm
Mon Jul 15 10:25:35 2013 +0200 (2013-07-15 ago)
changeset 52655 3b2b1ef13979
parent 52553 d5d150d159ad
permissions -rw-r--r--
more careful termination of removed execs, leaving running execs undisturbed;
     1 /*  Title:      Pure/System/cygwin.scala
     2     Author:     Makarius
     3 
     4 Support for Cygwin.
     5 */
     6 
     7 package isabelle
     8 
     9 
    10 import java.io.{File => JFile}
    11 import java.nio.file.{Paths, Files}
    12 
    13 
    14 object Cygwin
    15 {
    16   /* symlinks */
    17 
    18   def write_symlink(file: JFile, content: String)
    19   {
    20     require(Platform.is_windows)
    21 
    22     val path = file.toPath
    23 
    24     val writer = Files.newBufferedWriter(path, UTF8.charset)
    25     try { writer.write("!<symlink>" + content + "\0") }
    26     finally { writer.close }
    27 
    28     Files.setAttribute(path, "dos:system", true)
    29   }
    30 }
    31