6526860: (fc) FileChannel.position returns 0 when FileOutputStream opened in append mode

Rémi Forax forax at univ-mlv.fr
Thu Feb 17 12:34:21 PST 2011


On 02/17/2011 08:52 PM, Alan Bateman wrote:
>
> This one came up on the core-libs-dev mailing list last night [1].  
> When opened for append mode, FileChannel's position() will return 0 if 
> invoked prior to writing to the file. It doesn't really make sense to 
> use the position methods with files opened for append, the getChannel 
> defined by the stream classes does specify that the position be the 
> file size when opened for append so this should be fixed. The webrev 
> with the changes to fix this are:
>
> http://cr.openjdk.java.net/~alanb/6526860/webrev/
>
> Thanks,
> Alan.
>
> [1] 
> http://mail.openjdk.java.net/pipermail/core-libs-dev/2011-February/005920.html

Looks good.

Rémi



More information about the nio-dev mailing list