[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New IO Native Provider Interface
From: |
Stephen Crawley |
Subject: |
Re: New IO Native Provider Interface |
Date: |
Thu, 06 Mar 2003 17:36:21 +1000 |
> Aaron M. Renn wrote:
> > Jeroen Frijters (address@hidden) wrote:
> > > - FileOutputStream should not request read access, so the=20
> > modes should
> > > be "w" and "a"
> >=20
> > Good observation. Have you actually tested the JDK to see what it
> > does in this situation? Is the file actually opened "write only"?
>
> Yes, I have. Test code is attached (it should fail with
> "java.io.IOException: Access is denied"). Additionally, FileOutputStream
> (when it is not in append mode) should truncate the file if it already
> exists, so it also needs to use a different mode because of this.
With JDK 1.4.1_01, your test case gives:
Exception in thread "main" java.io.IOException: Bad file number
at java.io.FileInputStream.read(Native Method)
at iotest.main(iotest.java:10)