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

Alan Bateman Alan.Bateman at oracle.com
Thu May 9 10:01:11 PDT 2013


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.



More information about the nio-dev mailing list