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

Francis Galiegue fgaliegue at gmail.com
Fri Dec 5 23:18:20 UTC 2014


[...]
>
> FWIW, this is Linux (Ubuntu 14.10), 64bit, x86_64.
>
> Looking at all exceptions inheriting FileSystemException, in fact I
> see no equivalent to EISDIR anyway...
>

By the way, this is running 1.7.0u72 from Oracle; the result is the
same with 1.8.0u25.

I've had a report of a similar error on Mac OS X 10.10.1, 1.8.0u25.

>From a cursory analysis of the stack trace, it seems to me as the
implementation is common to both of them, and that the stream is not
actually opened until the first time it is read, and that open(2)
returns -EISDIR; hence the error message...

-- 
Francis Galiegue, fgaliegue at gmail.com, https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/parboiled1/grappa (redde
Caesaris: https://github.com/sirthias)


More information about the nio-dev mailing list