Skip to content

Fix FileSystemException in AbstractFileTest.scala #8274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion compiler/test/dotty/tools/io/AbstractFileTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
//
Expand All @@ -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)
Expand Down