(fs) Files.createDirectory fails if the resolved path is exactly 248 characters long

Kurchi Hazra kurchi.subhra.hazra at oracle.com
Thu May 9 11:19:26 PDT 2013


Hi Alan,

    This looks good to me, I had a question though. In the new test, 
while testing directory creation, why do
you test till MIN_PATH+1 and not till MIN_PATH?

- Kurchi

On 5/9/2013 10:01 AM, Alan Bateman wrote:
>
> This is a corner case on Windows with Files.createDirectory. If the 
> path to the directory, when resolved against the current directory, is 
> exactly 248 characters then the method fails because we have 
> pre-pended the long path prefix. The implementation is okay for <248 
> and >248, it's just the 248 case that isn't handled correctly.
>
> The fix is trivial, the addPrefixIfNeded method needs to add the long 
> path prefix when the resolved path is >= 248, not >248 as it was 
> doing. The webrev with the changes is here:
>
> http://cr.openjdk.java.net/~alanb/8011128/webrev/
>
> -Alan.
>

-- 
-Kurchi



More information about the nio-dev mailing list