Skip to content

[native-image] createTempFile().toPath() fails #1035

@johanvos

Description

@johanvos

The following application will cause an Error (at least on Linux):

import java.io.File;
import java.nio.file.Files;

public class HelloWorld {

    public static void main(String[] args) throws Exception  {
        File f = Files.createTempFile("foo", ".bar").toFile();
    }
}

Exception in thread "main" java.lang.UnsupportedOperationException: Path not associated with default file system.

For Path instances created using Paths.get(), the Path.getFileSystem() always returns the same value as FileSystems.getDefault(). However, Paths created via Files.createTempFile() return a different value for getFileSystem().

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions