RFR: 8356678: (fs) Files.readAttributes should map ENOTDIR to NoSuchFileException where possible (unix)

Brian Burkhalter bpb at openjdk.org
Mon May 12 19:41:14 UTC 2025


On Mon, 12 May 2025 19:36:22 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Treat `ENOTDIR` as causing a `NoSuchFileException` instead of a `FileSystemExcception` in some places in order to handle cases such as a regular file named, for example, `foo/bar`.

In addition to the changes provided in `fs.patch` attached to the issue, there is a change to `UnixFileSystem` to handle the same situation in `Files.copy`, and a new test is added.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25191#issuecomment-2873774990


More information about the nio-dev mailing list