From e17f1e1e95e188f296a001fceab140b4fe4fb855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Mon, 10 Feb 2020 12:13:20 +0100 Subject: [PATCH] fix FileSystemException in AbstractFileTest.scala --- compiler/test/dotty/tools/io/AbstractFileTest.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/test/dotty/tools/io/AbstractFileTest.scala b/compiler/test/dotty/tools/io/AbstractFileTest.scala index 221df8dfc227..b8ac74a0835a 100644 --- a/compiler/test/dotty/tools/io/AbstractFileTest.scala +++ b/compiler/test/dotty/tools/io/AbstractFileTest.scala @@ -4,6 +4,7 @@ import org.junit.Test import dotty.tools.io.AbstractFile import java.nio.file.Files._ +import java.nio.file.attribute.PosixFilePermissions class AbstractFileTest { // @@ -15,7 +16,11 @@ class AbstractFileTest { // private def exerciseSymbolicLinks(temp: Directory): Unit = { val base = { - val target = createTempDirectory(temp.jpath, "real") + val permissions = PosixFilePermissions.fromString("rwxrwxrwx") + val attributes = PosixFilePermissions.asFileAttribute(permissions) + // Specifying the 'attributes' parameter on Windows prevents a + // FileSystemException "A required privilege is not held by the client". + val target = createTempDirectory(temp.jpath, "real", attributes) val link = temp.jpath.resolve("link") createSymbolicLink(link, target) // may bail early if unsupported AbstractFile.getDirectory(link)