Review quest for 6595866: File does work with symbolic links (win,vista)

Alan Bateman Alan.Bateman at Sun.COM
Fri Jul 31 19:07:11 UTC 2009


Sherman, you'll probably want to take this one.

Windows Vista brought symbolic links to NTFS and they work well with the 
new file system API. This patch makes a start on fixing the issues with 
java.io.File when it encounters these alien creatures on a dark night. 
Specifically, it fixes the code used by the length, lastModified, 
exists, isXXX, canXXX, and setXXX methods so that the links work 
transparently. Currently these methods are using Win32 APIs that don't 
do reparse point processing and so do not access the attributes of the 
final target as expected. The other main issue fixed by this patch is to 
the createNewFile method so that it returns false when there is an 
existing file that is a symbolic link. One remaining issue that isn't 
addressed by this patch is canonicalization. That's a meal in itself and 
patch for another day.

In terms of compatibility, the only behavior change for pre-Vista 
(meaning XP and Windows Server 2003) is that the setReadOnly, 
setReadable and setWritable methods will fail if the File represents a 
path to a file that is a reparse point. I'm not too worried about that 
because they are so rare, and the methods do the wrong thing anyway.

Here's the webrev:
  http://cr.openjdk.java.net/~alanb/6595866/webrev.00/

Thanks,

Alan.








More information about the core-libs-dev mailing list