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

Alan Bateman alanb at openjdk.org
Wed May 14 17:31:53 UTC 2025


On Wed, 14 May 2025 17:21:13 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`.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8356678: Revert some of the ENOTDIR changes and update test

Latest version looks good, just a confusing summary in the NotADirectory test.

test/jdk/java/nio/file/Files/NotADirectory.java line 27:

> 25:  * @bug 8356678
> 26:  * @requires (os.family != "windows")
> 27:  * @summary Test files operations when a path component is not a regular file

I assume you meant to say "when a path component is not a directory".

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

Marked as reviewed by alanb (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25191#pullrequestreview-2840977470
PR Review Comment: https://git.openjdk.org/jdk/pull/25191#discussion_r2089415433


More information about the nio-dev mailing list