Code Review Request: 7168172: (fs) Files.isReadable slow on Windows

Alan Bateman Alan.Bateman at oracle.com
Thu Aug 23 01:54:09 PDT 2012


On 22/08/2012 19:38, Kurchi Hazra wrote:
> Hi,
>
>    Files.isReadable() is slow on Windows, since it involves reading 
> the DACL and computing the effective access to the file. [1]
> However, it is faster to simply open the file being checked and close 
> it. In the case of a directory then, a DirectoryStream can
> be opened and closed to check the same.
>
> Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7168172
> Webrev: http://cr.openjdk.java.net/~khazra/7168172/webrev.00/
>
> Thanks to Alan for helping out a lot with this fix.
Thanks for taking this one, the changes looks fine to me.

Just to put more context on this, this change improves the reliability 
and performance of the checkAccess() or checkAccess(READ) case, further 
work is required to test access when it includes WRITE or EXECUTE. The 
changes for this will be more extensive as it requires changing the 
win32 calls that this code is using.

-Alan.


More information about the nio-dev mailing list