Bug or not bug? Files.newInputStream() on a Path which is a directory does not fail until you read from it

Alan Bateman Alan.Bateman at oracle.com
Sat Dec 6 12:08:03 UTC 2014


On 05/12/2014 23:45, Brian Burkhalter wrote:
>
> Well, I don’t have the background in this area to know the history or 
> design intent, but to me it seems preferable to have fail fast 
> behavior such as that apparently implemented by newOutputStream.
>
newOutputStream doesn't actually do anything special here, it's just 
that the underlying open will fail on Linux and other platforms when you 
attempt to open a directory for write access.

-Alan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20141206/1c6f6b54/attachment.html>


More information about the nio-dev mailing list