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

Brian Burkhalter brian.burkhalter at oracle.com
Fri Dec 5 23:45:59 UTC 2014


On Dec 5, 2014, at 3:38 PM, Francis Galiegue <fgaliegue at gmail.com> wrote:

> On Sat, Dec 6, 2014 at 12:33 AM, Brian Burkhalter
> <brian.burkhalter at oracle.com> wrote:
> [...]
>> 
>> Same thing occurs on Mac OS 10.9.5 running Java 9-dev.
>> 
> 
> Well, I've just tried to open a new OutputStream; this time it does
> fail on .newOutputStream(), not when attempting to write to it...

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.

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20141205/18ed4b3f/attachment-0001.html>


More information about the nio-dev mailing list