RFR: 8287843: File::getCanonicalFile doesn't work for \?\C:\ style paths DOS device paths [v2]

Brian Burkhalter bpb at openjdk.org
Wed Sep 20 02:17:39 UTC 2023


On Mon, 11 Sep 2023 16:24:32 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> These also fail with "Bad pathname" with the master but give the erroneous results `C:\<user.dir>\\foo` and `C:`, respectively, with the patch. This needs to be fixed.

The problem here might be that `File.getCanonicalPath` resolves the path

return FS.canonicalize(FS.resolve(this));

before calling `FS.canonicalize`. It could be that if after stripping the `\\\?\` prefix the result is relative or drive-relative, then it should first be resolved in the same way before proceeding.

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

PR Comment: https://git.openjdk.org/jdk/pull/15603#issuecomment-1726779717


More information about the core-libs-dev mailing list