8066915: (fs) Files.newByteChannel opens directories for cases where subsequent reads may fail

Alan Bateman Alan.Bateman at oracle.com
Wed Dec 10 12:29:32 UTC 2014


As per a recent thread, it's currently possible to open a directory for 
read access but attempts to actually read will fail. As discussed we are 
missing a fstat to check the file type so that we can fail when creating 
the channel. The webrev with the changes to fix this are here:
   http://cr.openjdk.java.net/~alanb/8066915/webrev/

Thanks,
Alan.


More information about the nio-dev mailing list