some support for Cygwin;
authorwenzelm
Sun, 07 Jul 2013 22:58:34 +0200
changeset 52553 d5d150d159ad
parent 52552 0260bdba4dd7
child 52554 19764bef2730
child 52558 271663ddf289
some support for Cygwin;
src/Pure/System/cygwin.scala
src/Pure/build-jars
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/System/cygwin.scala	Sun Jul 07 22:58:34 2013 +0200
@@ -0,0 +1,31 @@
+/*  Title:      Pure/System/cygwin.scala
+    Author:     Makarius
+
+Support for Cygwin.
+*/
+
+package isabelle
+
+
+import java.io.{File => JFile}
+import java.nio.file.{Paths, Files}
+
+
+object Cygwin
+{
+  /* symlinks */
+
+  def write_symlink(file: JFile, content: String)
+  {
+    require(Platform.is_windows)
+
+    val path = file.toPath
+
+    val writer = Files.newBufferedWriter(path, UTF8.charset)
+    try { writer.write("!<symlink>" + content + "\0") }
+    finally { writer.close }
+
+    Files.setAttribute(path, "dos:system", true)
+  }
+}
+
--- a/src/Pure/build-jars	Sun Jul 07 20:23:09 2013 +0200
+++ b/src/Pure/build-jars	Sun Jul 07 22:58:34 2013 +0200
@@ -42,6 +42,7 @@
   PIDE/yxml.scala
   System/color_value.scala
   System/command_line.scala
+  System/cygwin.scala
   System/event_bus.scala
   System/gui.scala
   System/gui_setup.scala