equal
deleted
inserted
replaced
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 |
|