Skip to content

Commit 50d685e

Browse files
authored
Fix FileSystemException in AbstractFileTest.scala (#8274)
1 parent a5f1dae commit 50d685e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/test/dotty/tools/io/AbstractFileTest.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.junit.Test
44

55
import dotty.tools.io.AbstractFile
66
import java.nio.file.Files._
7+
import java.nio.file.attribute.PosixFilePermissions
78

89
class AbstractFileTest {
910
//
@@ -15,7 +16,11 @@ class AbstractFileTest {
1516
//
1617
private def exerciseSymbolicLinks(temp: Directory): Unit = {
1718
val base = {
18-
val target = createTempDirectory(temp.jpath, "real")
19+
val permissions = PosixFilePermissions.fromString("rwxrwxrwx")
20+
val attributes = PosixFilePermissions.asFileAttribute(permissions)
21+
// Specifying the 'attributes' parameter on Windows prevents a
22+
// FileSystemException "A required privilege is not held by the client".
23+
val target = createTempDirectory(temp.jpath, "real", attributes)
1924
val link = temp.jpath.resolve("link")
2025
createSymbolicLink(link, target) // may bail early if unsupported
2126
AbstractFile.getDirectory(link)

0 commit comments

Comments
 (0)