src/Pure/System/isabelle_system.scala
changeset 74070 a69a13c4b049
parent 73987 fc363a3b690a
child 74142 0f051404f487
--- a/src/Pure/System/isabelle_system.scala	Mon Jul 26 13:12:22 2021 +0200
+++ b/src/Pure/System/isabelle_system.scala	Tue Jul 27 13:12:27 2021 +0200
@@ -253,7 +253,7 @@
 
   /* symbolic link */
 
-  def symlink(src: Path, dst: Path, force: Boolean = false): Unit =
+  def symlink(src: Path, dst: Path, force: Boolean = false, native: Boolean = false): Unit =
   {
     val src_file = src.file
     val dst_file = dst.file
@@ -262,7 +262,14 @@
     if (force) target.delete
 
     def cygwin_link(): Unit =
-      isabelle.setup.Environment.cygwin_link(File.standard_path(src), target)
+    {
+      if (native) {
+        error("Failed to create native symlink on Windows: " + quote(src_file.toString) +
+          "\n(but it could work as Administrator)")
+      }
+      else isabelle.setup.Environment.cygwin_link(File.standard_path(src), target)
+    }
+
 
     try { Files.createSymbolicLink(target.toPath, src_file.toPath) }
     catch {