java.nio.file.Files.isReadable() returns false on readable file

Alan Bateman Alan.Bateman at oracle.com
Mon Jul 16 09:26:19 PDT 2012


On 16/07/2012 17:19, Victor Ott wrote:
> Hello,
>
> I've searched for similar issues and have found this thread int 
> nio-dev mailing list: "java.nio.file.Files.isReadable() slow on 
> Windows 7" ( 
> http://mail.openjdk.java.net/pipermail/nio-dev/2012-May/001666.html  
> or http://markmail.org/thread/ytjr6dwrxwxku2r4 ), but am asking this 
> on nio-discuss because ... maybe I'm not seeing the obvious.
> Besides noticing that the first call to Files.isReadable() is indeed 
> slow (only the first one, not subsequent calls), I have another issue: 
> Files.isReadable() fails an a obviously readable file. See below my 
> example code.
>
> Here the output:
> file: c:\temp\dummyfile.txt
> freshly read: ABC
> File.canRead():     true
> Files.isReadable(): false
>
> WinXP x32, JDK7u5 x32, NTFS file system. (And yes, I do have local 
> admin rights).
We have 7168172 open for this, sorry we don't have a solution for it 
yet. The reason for the issue is that the method tries to determine the 
effective access to the file and this is complex/expensive to do 
(File.canRead does not do this and so doesn't work correctly with ACLs 
on NTFS).

-Alan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20120716/bbef7844/attachment.html 


More information about the nio-discuss mailing list